In the Write a page, the authenticated user does not log in or the session fails when the popup login box prevents page scrolling
Today, a function, the upper and lower left and right center, imitating the style of QQ space, the horizontal and vertical scroll bar to prohibit the code as follows:
<script type= "Text/javascript" >
Prohibit scroll bar
$ (document.body). CSS ({
"Overflow-x": "Hidden",
"Overflow-y": "Hidden"
});
Enable scroll bars
$ (document.body). CSS ({
"Overflow-x": "Auto",
"Overflow-y": "Auto"
});
</script>
I believe that you should have no objection to this code, if you have to give guidance to the master. The test results are as follows:
IE6: Disable scroll bar normal, start scroll bar error, double scroll bar appears and scroll bar scrolling page is unresponsive.
IE7: Disable scroll bar normal, start scroll bar error, double scroll bar appears and scroll bar scrolling page is unresponsive.
IE8: Disable scroll bar normal, start scroll bar normal.
IE9: Disable scroll bar normal, start scroll bar normal.
Chrome: Disable scroll bar normal, start scroll bar normal.
FireFox: Disable scroll bar normal, start scroll bar normal.
Rely on, again IE6 and IE7, Microsoft really should reflect on, so say do product must start to be responsible. Don't get far, the solution is to cancel this style without setting the overflow after overflow set hidden, the code is as follows:
To easily define a style class
<style type= "Text/css" >
. html-body-overflow
{
Overflow-x:hidden;
Overflow-y:hidden;
}
</style>
<script type= "Text/javascript" >
Prohibit scroll bar (default is not attached to this style class)
$ (document.body). Toggleclass ("Html-body-overflow");
Start scroll bar
$ (document.body). Toggleclass ("Html-body-overflow");
</script>
Of course, you can also directly clear the content of style, but the above approach is more intuitive, more simple.
The Html body scroll bar is disabled and enabled