Results 1 to 1 of 1

Thread: Control your CSS DDM L1 link when IE 5&6 scripting disabled!

  1. #1
    Join Date
    Sep 2008
    Posts
    899

    Control your CSS DDM L1 link when IE 5&6 scripting disabled!

    Through trial and error, I've discovered a way to automatically display the top level of my CSS drop-down menu WITHOUT a link if a user's IE 5 and/or IE6 has scripting enabled, and WITH a link if a user's IE 5 and/or IE6 has scripting disabled. In everything except (scripting disabled) IE 5 and 6, it displays with no link.

    I don't want a link on the top level of my CSS drop-down menu unless it's absolutely necessary. IE5 and IE6 need scripting enabled for the DDM to work so I alternately provide the lower level links via a page refresh and a php include for IE5 & IE6 scripting disabled users. But I think having the top level displayed with a link for other browsers and later IE versions looks redundent, sloppy and just creates confusion.

    I've tried it in IE 5.5, 6, 7, and (7 emulated) 8 and also in Opera, Safari, Firefox and Chrome. Seems to work great. The code is below.

    What do you think?

    Code:
    <ul>
    		<li style="border: 1px solid black;"><!--[if lt IE 7]><SCRIPT type="text/javascript"> document.write("<a>States</a>") </SCRIPT><![endif]-->
    						     <noscript><!--[if lt IE 7]><a href="index.php?i=statemenu">States</a><![endif]--></noscript>
    						     <!--[if !(lt IE 7)]><a>States</a><![endif]-->
    						     <![if !IE]><a>States</a><![endif]>
    		<ul>
    		<li><a href="#">Alabama</a>
    		<a href="#">Alaska</a>
    		<a href="#" title="US Territory">American Samoa</a>
    		<a href="#">Arizona</a>
    		<a href="#">Arkansas</a>
    		<a href="#">California</a></li>
    		</ul>
    		</li>
    	</ul>
    Last edited by djlebarron; 14 Apr 2009 at 08:30 AM.

Posting Permissions

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