Note that there are some explanatory texts on larger screens.

plurals
  1. PORemove vertical scrollbar on fullscreen?
    primarykey
    data
    text
    <p>I want to remove vertical scrollbar after switch to fullscreen.</p> <p>This is the script I'm using at the moment:</p> <pre><code>&lt;script type="text/javascript"&gt; if((window.fullScreen) || (window.innerWidth == screen.width &amp;&amp; window.innerHeight == screen.height)) { $("html").css("overflow", "hidden"); } else { $("html").css("overflow", "auto"); } &lt;/script&gt; </code></pre> <p>I've tried like this without any success:</p> <pre><code>&lt;script type="text/javascript"&gt; if(window.fullScreen) { $("html").css("overflow", "hidden"); } else { $("html").css("overflow", "auto"); } &lt;/script&gt; </code></pre> <p>Tank you as always.</p> <p>EDIT: <code>&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;</code> is being loaded and other jquery script's are working ok.</p> <p>EDIT: I've tested with:</p> <pre><code>$(document).ready(function() { $("body").css("overflow", "hidden"); }); </code></pre> <p>And it works! So I believe that for some reason the JavaScript condition code it's not working! <code>if((window.fullScreen) || (window.innerWidth == screen.width &amp;&amp; window.innerHeight == screen.height))</code>...</p> <p>EDIT:</p> <p>Solution found!</p> <pre><code>&lt;script type="text/javascript"&gt; var control = 0; function scrollbar(){ if(event.keyCode == 122 &amp;&amp; control == 0){ //remove scrollbar $("body").css("overflow", "hidden"); control = 1; } else{ //add scrollbar $("body").css("overflow", "auto"); control = 0; } } &lt;/script&gt; </code></pre> <p>If you want to use this don't forget to attach the function to the body for example like:</p> <pre><code>&lt;body onkeydown="scrollbar();"&gt; </code></pre> <p>UPDATE:</p> <p>Work's in chrome, opera, ie, safari except for firefox! What can be done to fix firefox?</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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