...

View Full Version : Scroll Problem



quocbao
07-03-2005, 03:09 AM
Hi

I have a problem during creating a floating bar . It will move when you scroll .
I use onscroll event . But when i use it in punBB board , it doesn't move when i scroll (i use this forum http://punbb.org/forum)

here the code



<script language=javascript>
if (typeof(__LOAD__) == 'undefined')
{
__LOAD__ = true;
__SMILEBOX__();
}

function __SMILEBOX__()
{
//render image
this.render = function()
{
html = "";

return html;
}
//add div object
__DIV__ = document.createElement('DIV');
__DIV__.style.position = "absolute";
__DIV__.style.left = document.body.scrollLeft + 15;
__DIV__.style.top = document.body.scrollTop + 20;
__DIV__.style.width = "150px";
__DIV__.style.height = "200px";
__DIV__.style.filter = "alpha(opacity=50); -moz-opacity: 0.5;";
__DIV__.style.border = "1px solid black";
__DIV__.style.background = "#FFFFFF";
__DIV__.style.zIndex = "9999";
__DIV__.innerHTML = this.render();
document.body.appendChild(__DIV__);
this.__DIV__ = __DIV__;
this.__SCROLL__ = window.onscroll;
this.doscroll = function()
{
if (this.__SCROLL__) this.__SCROLL__();
this.__DIV__.style.top = document.body.scrollTop + 20;
this.__DIV__.style.left = document.body.scrollLeft + 15;

}
window.onscroll = this.doscroll;
}
</script>

_Aerospace_Eng_
07-03-2005, 03:38 AM
does it work on a normal page? Whats up with your naming technique? Can you not find better names?

quocbao
07-03-2005, 06:55 AM
:)

It worked on normal page , but it didn't work on some page (like http://punbb.org/forum)

I don't know why ?

quocbao
07-04-2005, 05:22 AM
Anyone help me plz :(



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum