0

Here...

http://www.allaboutvision.com/test/SWIM-ryan2.htm

...I have a non-scrolling ad in the right-hand column. It works great, but I need a couple more tweaks.

First, the stop-scroll action begins at an absolute pixel amount from the top of the page. Instead, I need that action to begin at an absolute pixel amount below the previous div, which has the id of "relProd". I don't know how to specify that in the javascript.

Secondly, I need the image to begin scrolling again at a fixed pixel amount above the orange ad at the bottom of the page. (In other words, it needs to "brake" at a certain point so it doesn't cover up the orange ad.)

Can anyone help me? I've searched everywhere for the answer. Wish I knew more javascript.

Thanks!

Ethelred
  • 13
  • 3

1 Answers1

0

I think it would be best that you read this Get X Y position so that you can get the position of an element on the screen then just set a function onscroll which will run every time a user scrolls up/down

Something like this:

window.onscroll = function(e){
    if(in this position){
        //do this
    }else if(in this position){
        //do this
    }
}
Community
  • 1
  • 1
Jo E.
  • 7,822
  • 14
  • 58
  • 94