Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Drop Down Navigation issue in IE

    Hi everyone,

    I'm having some issues with drop down navigation working in IE (I've tried IE8 and 9)

    Here is the site I'm working on: http://www.umresearch.umd.edu/ORAA/c...min/about.html

    I am using a variation of the Suckerfish drop down found here: http://www.htmldog.com/articles/suckerfish/dropdowns/

    This code includes 12 lines of javascript to work in IE. While the menu works and functions, the drop down background color is ignored, defaulting to white and making it hard to read since it blends in with the rest of the page.

    Thank you in advance for your help! I'm pasting my code below:

    HTML:

    Code:
    [<ul id="nav">
    	<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/about.html">About</a>
    		<ul>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/about/news.html">News</a></li>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/about/contact.html">Contact</a></li>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/about/listserv.html">Listserv</a></li>
    		</ul>
    	</li>
    
    	<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/modules.html">Modules</a>
    		<ul>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/modules/prop-dev.html">Proposal Development</a></li>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/modules/inst-proposal.html">Institute Proposal</a></li>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/modules/award.html">Award</a></li>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/modules/subcontracts.html">Subcontract</a></li>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/modules/person.html">Person</a></li>
    		</ul>
    	</li>
    
    	<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/training.html">Training</a>
    		<ul>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/training/basics.html">Basics Training</a></li>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/training/adhoc.html">Ad hoc Training</a></li>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/training/subawards.html">Subawards</a></li>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/training/wow.html">Warehouse on the Web</a></li>
    		</ul>
    	</li>
    
    	<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/resources.html">Resources</a>
    		<ul>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/install.html">Coeus Installation Guide</a></li>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/basics-manual.html">Coeus Basics Manual</a></li>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/adhoc-manual.html">Coeus Ad hoc Manual</a></li>
    			<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/subawards-manual.html">Coeus Subawards Manual</a></li>
    		</ul>
    	</li>
    
    	<li><a href="http://www.umresearch.umd.edu/ORAA/coeus/bus-admin/FAQs.html">FAQs</a>
    
    	</li>
    
    </ul>
    Javascript:

    Code:
    <script type="text/javascript">
    //<![CDATA[
    sfHover = function() {
    	var sfEls = document.getElementById("nav").getElementsByTagName("li");
    	for (var i=0; i<sfEls.length; i++) {
    		sfEls[i].onmouseover=function() {
    			this.className+=" sfhover";
    		}
    		sfEls[i].onmouseout=function() {
    			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
    		}
    	}
    }
    if (window.attachEvent) window.attachEvent("onload", sfHover);
    
    // ]]>
    </script>
    and CSS:

    Code:
    #nav ul { 
    	margin: 0;
    	padding: 0;
    	list-style: none;
    	background: #e0e0dc;
    	float: left;
    	line-height: 25px;
     }
    	
    
    #nav a {
    	display: block;
    	padding: 0px;
    	text-align: center;
    	color: #000000;
    	width: 12em;
    	border: 1px solid #ffffff;
    	border-top: none;
    	border-left: none;
    	text-decoration: none;
    
    }
    
    #nav li a:hover{
    	background: #cc0000;
    	color: #ffffff;
    
    } 
    #nav li {
    	float: left;
    	width: 12em;
    	padding: 0;
    	text-align: left;
    }
    
    
    #nav li ul {
    	position: absolute;
    	width: 12em;
    	left: -999em;
    }
    
    #nav li:hover ul {
    	left: auto;
    }
    
    #nav li:hover ul, #nav li.sfhover ul {
    	left: auto;
    }
    
    #nav li.sfhover ul { background: #ffffff;}
    
    #nav {
    	margin: 0;
    	padding: 0;
    	list-style: none;
    	background: #c2c1ba;
    	float: left;
    	width: 962px;
    	height: 25px;
    	line-height: 25px;
    	z-index: 1000;
    
    }
    Last edited by EHunter; 04-04-2011 at 05:42 PM. Reason: Resolved!

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Good morning EHunter,
    Instead of putting that background on the ul, does it work better if you put in on the anchor?
    Try it like this -
    Code:
    #nav ul { 
    	margin: 0;
    	padding: 0;
    	list-style: none;
    /*background: #e0e0dc;*/
    	float: left;
    	line-height: 25px;
     }
    #nav ul li a {background: #e0e0dc;}
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wow-Thank you, Excavator!
    Problem fixed!


  •  

    Posting Permissions

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