On a page I'm developing for a client http://webadit.co.uk/cakelady/?page=weddingrange# I have three hidden 'slide-shows' which are made to appear by clicking one of the headings (currently shown in brown colour).
My problem is that when any slide-show appears, the page scrolls to the top. This is OK for the first two, but the third slideshow always appears off-screen, so the visitor won't see it unless they scroll down.
I've tried putting
into the JS function, but it seems to get ignored*, and
alert ("Screen Top = " + window.screenY);
always gives the answer '-4'. Just by way of a test I've put the same scroll command to run on page load, and it seems to work there (not shown in the example in the link).
*I don't think it's actually ignored, it seems to work and then get over-ruled.
When the example runs there are some 'alert' messages, the first of which isn't directly relevant, but serves to stop the action. After this is dismissed the page scrolls as required, but the next alert shows '-4', and when that's dismissed the page scrolls to the top, exactly what I do not want !
I'm testing in Firefox 8. I've not tried elsewhere yet.
Can anyone help with this problem, please ?
The solution wasn't all that difficult in the end. I got the solution from the JQuery forum.
I just needed to add "return false" to the onclick event handlers. Works a treat.
This topic is now closed. New replies are no longer allowed.