Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can adjusted font size be carried over to pages subsequently visited?
    primarykey
    data
    text
    <p>I use the below script to allow visitors to my page to increase / decrease the font size (or restore the font size to its default setting). </p> <p>Does anybody know how I could get each page to retain the increased/decreased font size of the previous page? Currently, when a visitor adjusts the font size and goes to another page the font size returns to the default size, meaning that the visitor then has to re-adjust the font size again for each page they visit. It would be nice if once the visitor adjusts the page size on one page and then goes to another page, that other pager would automatically appear in the adjusted font size. Thank you, Chris</p> <pre><code>function changeFontSize(objId, doIncreaseSize) { var currentSize = 0, obj = document.getElementById(objId), newVal = 0, limitMax = 1.7, limitMin = 0.9, unit = 0.1; if(!obj){ return false; } currentSize = parseFloat( obj.style.fontSize ); if (!obj.originalSize) { obj.originalSize = currentSize; } if(doIncreaseSize){ unit = -unit; } newVal = currentSize - unit; if(limitMax &gt;= newVal &amp;&amp; limitMin &lt;= newVal){ obj.style.fontSize = newVal + "em"; } return true; } function resetDefaultSize(objId) { var obj = document.getElementById(objId); if(!obj){ return false; } if (obj.originalSize) { obj.style.fontSize = obj.originalSize + "em"; } return true; } </code></pre> <p>And the HTML:</p> <pre><code>INCREASE: &lt;href="#" onclick="changeFontSize('mydiv', true); return false;"&gt; DECREASE: href="#" onclick="changeFontSize('mydiv'); return false;"&gt; RESET TO DEFAULT: &lt;href="#" onclick="resetDefaultSize('mydiv'); return false;"&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload