PDA

View Full Version : switchcontent script and page jump



esmoldt
12-22-2010, 05:04 PM
http://dynamicdrive.com/dynamicindex17/switchcontent.htm

I use switchcontent.js on my site (www.purdue.edu/recsports) and I would like the collapsed content to open "down" on the page. Currently, if you are scrolled down at all, and you click on the header to open the content, it makes the page jump back to the top. This isn't a problem if the current page doesn't overflow but is quite confusing if you have scrolled down, clicked the header, and the page jumps back to the top. Here's an example of what I'm talking about http://www.purdue.edu/recsports/programs/boiler_challenge/courses.php. Try expanding all, scroll down, and click one of the headers.

Does anyone know how to change this?

Thanks!

ddadmin
12-22-2010, 08:26 PM
The reason the headers "jump" right now when clicked on is because they are hyperlinked. Simply remove the link inside each header, for example:


<h4 id="course3-title" class="handcursor"><a href="#">Combo Team Challenge Course</a></h4>

Take out the code in red.

esmoldt
12-22-2010, 09:00 PM
Fantastic! I have been trying to fix this for a long time but couldn't figure it out. Thank you for your help!