I am trying to alter the positioning of a lightbox with some JS (so that it doesn’t go off the screen) but this doesn’t seem to be recognised. Should I be using something different to find how far down the window has been scrolled?
This is good information - thanks. Yes it is JQuery but I’m still playing around with it - I’ve noticed that the last brackets are causing the function not to work:
$(window).scrollTop[B]()[/B]
… but it still doesn’t register it like this and window.scrollY didn’t either and nor did $(document).scrollTop … and $(body).scrollTop stopped the function working.
…I’m not sure the right combo - can you provide anything else that might do it?
This was resolved by downloading and using a newer version of JQuery - I believe some earlier versions don’t allow for this.
I am also trying to keep the lightbox on screen without going off to the right so I attempted to include another condition in the JS (as well as the one mentioned) but it couldn’t work so I’m thinking that my syntax was incorrect.
Can anyone help me to understand if there are different methods for different browsers when conditioning in a Jquery function?? I can’t find info about this…