Results 1 to 2 of 2

Thread: Display div once you scroll down the page...challenge?

  1. #1
    mikemiketm09 is offline New Member: Posts Will Be Moderated
    Join Date
    Mar 2011
    Posts
    1

    Display div once you scroll down the page...challenge?

    Is this a challenge. What I need to do is have a sidebar that is fixed while scrolling the page. But I need this sidebar to fade in once you scroll so far into the page and fade away when you scroll back to the top. Is this possible? All help appreciated!

  2. #2
    Join Date
    Mar 2011
    Posts
    38
    Hello Friend,
    define a function on the mouse scroll event like this below
    window.onload = function()
    {
    //adding the event listerner for Mozilla
    if(window.addEventListener)
    document.addEventListener('DOMMouseScroll', moveObject, false);

    //for IE/OPERA etc
    document.onmousewheel = moveObject;
    }

    Then in that function you have to check the position of the scroll bar if it exceeds the actual page size you have to reduce the opacity for the div and if it moves towards the actual page height increase the opacity of the div.

    This info would help you solve your challenge.


    Ahamed

Similar Threads

  1. Scroll Bar in Fixed Height Div
    By tribethrow in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 18 Feb 2010, 02:40 PM
  2. iframe doesnt scroll with parent div IE7
    By xnewbie in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 09 Feb 2010, 09:45 AM
  3. DIV Scroll Bar locked with an image...
    By vn1985 in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 04 Jan 2010, 09:50 PM
  4. A page that doesn't scroll vertically?
    By sing1ejack in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 13 Dec 2006, 01:40 AM

Posting Permissions

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