PDA

View Full Version : Resolved Switch Content Script - disable contract if possible



k9brand
03-14-2010, 07:47 PM
1) Script Title:
Switch Content Script

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

3) Describe problem:
After expanding an item, I want to disable the contraction if the user clicks on the link a 2nd time.

Reason: using this for simple top-level navigation. I always want to have 1 DIV expanded at any given time.

Example:
ContentLink1 - Content1 (expanded by default when the page loads)
ContentLink2 - Content2 (hidden)
ContentLink3 - Content3 (hidden)
ContentLink4 - Content4 (hidden)

User is at the main page (content1) and clicks on ContentLink2.

Result:
ContentLink1 - Content1 (hidden)
ContentLink2 - Content2 (expanded)
ContentLink3 - Content3 (hidden)
ContentLink4 - Content4 (hidden)

Up to this point, it works as expected. However, if the user clicks on ContentLink2 AGAIN the following happens:

ContentLink1 - Content1 (hidden)
ContentLink2 - Content2 (hidden)
ContentLink3 - Content3 (hidden)
ContentLink4 - Content4 (hidden)

The result is no content on the page. Is there any way to disable ContentLink2 when that link has been clicked? This would ensure content is always on the page.

ddadmin
03-14-2010, 09:30 PM
Have you checked out this thread: http://www.dynamicdrive.com/forums/showthread.php?t=29477

k9brand
03-14-2010, 09:37 PM
thanks!

I did do a search before I posted, but missed that one.