Results 1 to 3 of 3

Thread: Help with NOSCRIPT version

  1. #1
    Join Date
    Mar 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with NOSCRIPT version

    I'm trying to do a NOSCRIPT version of SwitchContent but I am having trouble with mixing JS and PHP code. Here's my PHP code:

    Code:
    	echo "<div id=\"".$party_id."-title\" class=\"header_yellowdark
    	\" style=\"margin-top:4px; margin-bottom:4px\">".$h_party_name."</div>\n";
    
    	echo "<div id=\"".$party_id."\" class=\"switchgroup_parties\">\n";
    	include ("inc/resultparties_switchcontent.inc");
    	echo "\n</div>\n";
    	// texbox_white closing
    	echo "</div>\n";
    }
    ?>
    
    <script type="text/javascript">
    var switchparty=new switchcontent("switchgroup_parties", "div") //Limit scanning of switch contents to just "div" elements
    switchparty.setStatus('<img src="images/expander_down.gif" hspace="4" alt="" width="10" height="10"> ', '<img src="images/expander.gif" hspace="4" alt="" width="10" height="10"> ')
    //switchparty.setColor('black', 'black')
    switchparty.setPersist(false)
    switchparty.collapsePrevious(true) //Only one content open at any given time
    switchparty.init()
    </script>
    When JS is turned off, I would like the content to be hidden and have a href link to a page around $h_party_name.

    Can someone help me with this?

    Thank you.

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    The only way to "hide" a div when JS is turned off, is to hide it with CSS (so that it will automatically be hidden), and use the style attribute in JavaScript to show it. So now, if JS is turned off it will be hidden via CSS.
    - Mike

  3. #3
    Join Date
    Mar 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Maybe I wasn't clear, I am not trying to hide the content, but in the contrary offer an alternative when JS is turned off. I'm just having trouble inserting the <noscript> code in my PHP code.

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
  •