Help with spry sliding panels

Loop

Active Member
Joined
Sep 4, 2007
Messages
50
Hi,

Im making use of spry sliding panels to display my portfolio on my website. The panels are working fine, only problem is when I click the link to change the panel, the browser jumps to the top of the page.

This could quite annoying to visitors since they then need to scroll back down the page to view the next panel.

Anyone know how to prevent this from happening?
 

Raithlin

Executive Member
Joined
Jan 4, 2005
Messages
5,049
You're using anchors (with href="#") - it's the default action from the anchor which is sending you back to the top of the page. 2 ways to get around this.

1. Use another tag (span, anyone?) - javascript can be attached to anything, not just anchors.
2. return false after calling the function. This will prevent the browser from processing the default action afterwards.

Hope that helps.
 

Raithlin

Executive Member
Joined
Jan 4, 2005
Messages
5,049
For the record, you could remove the href="#" - you don't need it, and it isn't performing any other accessibility function as far as I can see.
 
Top