Results 1 to 3 of 3

Thread: Switch Content Script: About Contract All and Expand All, Need Help!

  1. #1
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Switch Content Script: About Contract All and Expand All, Need Help!

    Hello,

    I am using the script from this link below and I am trying to figure out this:

    Is there a way to hide and show the "Contract All" and "Extract All" from each other? It's kind of hard to explain, but let's say there are no content to extract, the link "Contract All" won't appear and when there is, the link will show. Pretty much toggle between the two links. Is there a way to do it? I hope this isn't too confusing.

    Here is the link to the script I am basing off from:

    http://www.dynamicdrive.com/dynamici...tchcontent.htm

    Thanks. I appriciate it.


    ***EDIT: Shoot, didn't realize there was a separated section for Dynamic Drive scripts. Sorry about that!
    Last edited by OrangeHair83; 11-02-2006 at 04:00 AM.

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,626
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    I don't think this is the correct place for posting DD Scripts related problems.

    The toggling between the contract all | expand all links can be done using the following steps

    1. Insert the following javascript function inside the head section
    Code:
    function visible(p)
    {
    	if(p)
    	{
    		document.getElementById('expand').style.visibility = "hidden";
    		document.getElementById('contract').style.visibility = "visible";
    	}
    	else
    	{
    		document.getElementById('expand').style.visibility = "visible";
    		document.getElementById('contract').style.visibility = "hidden";
    	}
    }
    2. Edit the contract all | expand all link part like the following

    <!--Optional Expand/ Contact All links. Remove if desired-->
    <div><a id="contract" href="javascript:sweeptoggle('contract')" onClick="visible(0);">Contract All</a> | <a id="expand" href="javascript:sweeptoggle('expand');" onClick="visible(1);">Expand All</a></div>

    This will perform the toggling upto a point.

  3. #3
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks! With this I was able to get as further as I needed. I appriciate it!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •