Log in

View Full Version : Looking for mod for Switch Content Script!



Kegroll
10-14-2012, 06:44 PM
Ive recently dived into responsive design for use with mobile devices. Im really enjoying the concept and its got me back into web design. Ive been using Switch Content Script (http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm) as this is a perfect way to build my site foundations for mobile websites. However, Ive run into an issue and would kindly ask if anyone knows how to do a simple (I believe) task with the Switch Content Script.

Id like for it to pop the selected to the top of the device. That is, when a user clicks (touchs lets say the link on an iPhone), the script would pop the content to the top of the screen. As it stands now, when you touch a link, it does open the content up, however, you have to scroll down the page to view the content rather than when you touch the link, it starts at the top of the page.

I hope you understand what Im trying to describe here. And please, any help would be appreciated. TIA.

jscheuer1
10-15-2012, 03:39 AM
This script doesn't go to the top of the page when one of its triggers is activated. If it does on your page, you've done something wrong.

On the other hand, if you've placed all the triggers in one location - say at the top of the page, and the expanding content elsewhere, lower on the page, I could see a reason to want the page to scroll to the expanded content.

However, this script:

http://www.dynamicdrive.com/dynamicindex17/ddaccordion.htm

already does that. On the demo page, see the example titled:

onClick example with icon indicators:

Kegroll
10-15-2012, 02:34 PM
@jscheuer1

Indeed that scripts onClick function is exaclt what Im looking for. However, I cannot use that script because if you notice, you click on a link, it expands then scrolls to the top, but, when you click another link, the other links youve clicked stay expanded. Also, the script Im using is much smaller.

jscheuer1
10-15-2012, 04:31 PM
Read through the demo page. It can be configured to only allow one item open at a time. The script size is immaterial, even with the Google hosted jQuery code, which most users will already have cached anyway, the size of the script is smaller than most images, so will not contribute noticeably to the load time of the page.