Originally Posted by
Markku
Yes, I know. Create placeholder on the popup layer that has to be "floating" and put following code in it:
Code:
<div class="my_noscroll_id"></div>
<script class="text/javascript">//<!--
if(!my_noscroll_used){my_noscroll_old = window.onscroll; window.onscroll=my_noscroll;}
var my_noscroll_sxo=0;var my_noscroll_syo=0;
function my_noscroll(e){var sx=0;var sy=0;
if(my_noscroll_old)my_noscroll_old(e);
if(typeof(window.pageXOffset)=='number'){sx=window.pageXOffset;sy=window.pageYOffset;}else if(document.body && (document.body.scrollLeft || document.body.scrollTop))
{sx=document.body.scrollLeft;sy=document.body.scrollTop;}else{ sx=document.documentElement.scrollLeft;sy=document.documentElement.scrollTop;};
var t = document.getElementsByTagName("div");var i;
for(i=0; i<t.length; i++) {
if (t[i].className=="my_noscroll_id"){var o=t[i].parentNode.parentNode.parentNode;
o.style.left=(parseInt(o.style.left)+sx-my_noscroll_sxo)+"px";o.style.top=(parseInt(o.style.top)+sy-my_noscroll_syo)+"px";
};};my_noscroll_sxo=sx;my_noscroll_syo=sy;};
var my_noscroll_used=1;//-->
</script>
You can use it on multiple popups if needed.
I'll add this to the tweakset together with a few more snippets soon.
Bookmarks