View Full Version : Switch Content Script - collapsing long text

04-11-2009, 05:44 PM
1) Script Title: Switch Content Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm

3) Describe problem: Hi, I've been able to setup your script on an information page of mine and the script itself works superbly. There is one thing that I hope can be improved for my situation: I have 5-8 contracted headers to start with. Each of them has quite a bit of hidden text to expand. So when I hit the first header, the text expands and the rest of the headers move down and off the screen. When I scroll down to the end of the expanded text and press the second header, the first one contracts, the second one expands at its original position, but the screen remains at its current spot. This means that the screen now only shows halfway the expanded text of the second header. So I have to scroll up again to the beginning of the new text.

Would it be possible to add some coding to automatically jump to the first line of the expanded text each time you hit a header?


10-18-2012, 09:04 PM

I'm having this same issue. Is there a fix?

10-19-2012, 10:35 AM
Would an HTML anchor not suffice?

Something like this?

<h3 id="bobcontent1-title" class="handcursor"> <a href="#jump"> What is JavaScript? </a> </h3>
<div id="bobcontent1" class="switchgroup1">
<a name="jump"></a> JavaScript is a scripting language originally developed by Netscape to add interactivity
and power to web documents. It is purely client side, and runs completely on the client's browser and computer.