Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Scroll Problem

  1. #1
    New Coder
    Join Date
    May 2005
    Location
    Vietnam
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Scroll Problem

    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>

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    does it work on a normal page? Whats up with your naming technique? Can you not find better names?

  • #3
    New Coder
    Join Date
    May 2005
    Location
    Vietnam
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts


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

    I don't know why ?

  • #4
    New Coder
    Join Date
    May 2005
    Location
    Vietnam
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Anyone help me plz


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •