SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2006
    Location
    Essex, UK
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    onmouseover CSS - fine in Opera and IE but not Firefox

    My client wants the sub navigation to appear when the main navigation is hovered (sub pages then appear).

    This works fine in IE and Opera (see http://thepritchardgroup.net/ ) however in FireFox nothing happens.

    Any help?

    Related CSS:
    Code:
    .hidden {
    display: none;
    }
    Related HTML:
    Code:
    	<ul id="nav">
    		<li<?php if(is_page('2')) { ?> class="current_page_item"<?php } ?>><a href="<?php bloginfo('url'); ?>/?page_id=2" title="About Us" onmouseover="subnav2.style.display = 'block'; subnav3.style.display = 'none';  subnav4.style.display = 'none';  subnav5.style.display = 'none';  subnav7.style.display = 'none'; ">About Us</a></li>
    		<li<?php if(is_page('3')) { ?> class="current_page_item"<?php } ?>><a href="<?php bloginfo('url'); ?>/?page_id=3" title="Expertise" onmouseover="subnav3.style.display = 'block'; subnav2.style.display = 'none';  subnav4.style.display = 'none';  subnav5.style.display = 'none';  subnav7.style.display = 'none'; ">Expertise</a></li>
    		<li<?php if(is_page('4')) { ?> class="current_page_item"<?php } ?>><a href="<?php bloginfo('url'); ?>/?page_id=4" title="Clients" onmouseover="subnav4.style.display = 'block'; subnav3.style.display = 'none';  subnav2.style.display = 'none';  subnav5.style.display = 'none';  subnav7.style.display = 'none'; ">Clients</a></li>
    		<li<?php if(is_page('5')) { ?> class="current_page_item"<?php } ?>><a href="<?php bloginfo('url'); ?>/?page_id=5" title="Contact Us" onmouseover="subnav5.style.display = 'block'; subnav3.style.display = 'none';  subnav4.style.display = 'none';  subnav2.style.display = 'none';  subnav7.style.display = 'none'; ">Contact Us</a></li>
    		<li<?php if(is_page('6')) { ?> class="current_page_item"<?php } ?>><a href="<?php bloginfo('url'); ?>/?page_id=6" title="Site Map" onmouseover="subnav2.style.display = 'none'; subnav3.style.display = 'none';  subnav4.style.display = 'none';  subnav5.style.display = 'none';  subnav7.style.display = 'none'; ">Site Map</a></li>
    		<li<?php if(is_page('7')) { ?> class="current_page_item"<?php } ?>><a href="<?php bloginfo('url'); ?>/?page_id=7" title="Disclaimer" onmouseover="subnav7.style.display = 'block'; subnav3.style.display = 'none';  subnav4.style.display = 'none';  subnav5.style.display = 'none';  subnav2.style.display = 'none'; ">Disclaimer</a></li>
    	</ul>
    
    AND
    
    	<div id="sub-nav-wrap">
    	
    	<ul id="subnav2"<?php if(!is_page('2')) { echo ' class="hidden"'; } ?>>
    		<?php wp_list_pages("title_li=&child_of=2&sort_column=menu_order&show_date=modified&date_format=$date_format&depth=-1"); ?>
    	</ul>
    
    	<ul id="subnav3"<?php if(!is_page('3')) { echo ' class="hidden"'; } ?>>
    		<?php wp_list_pages("title_li=&child_of=3&sort_column=menu_order&show_date=modified&date_format=$date_format&depth=-1"); ?>
    	</ul>
    
    	<ul id="subnav4"<?php if(!is_page('4')) { echo ' class="hidden"'; } ?>>
    		<?php wp_list_pages("title_li=&child_of=4&sort_column=menu_order&show_date=modified&date_format=$date_format&depth=-1"); ?>
    	</ul>
    	
    	<ul id="subnav5"<?php if(!is_page('5')) { echo ' class="hidden"'; } ?>>
    		<?php wp_list_pages("title_li=&child_of=5&sort_column=menu_order&show_date=modified&date_format=$date_format&depth=-1"); ?>
    	</ul>
    	
    	<ul id="subnav7"<?php if(!is_page('7')) { echo ' class="hidden"'; } ?>>
    		<?php wp_list_pages("title_li=&child_of=7&sort_column=menu_order&show_date=modified&date_format=$date_format&depth=-1"); ?>
    	</ul>
    I will be really grateful if you could help and would throw some money your way (if the mods allow it, that may make it classed at hiring).

    Thanks, Andy

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Try using:
    Code:
    document.getElementById('subnavx').style.display = 'block';
    Saul

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2006
    Location
    Essex, UK
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you EVER so much. Works perfectly!

  4. #4
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is a better way to create dropdown menus...

    http://www.sitepoint.com/forums/show...54&postcount=2

    (the above link deals with horizontal menus; it contains a link to another post of mine that shows how to create vertical menus--note that I refer to the main menu, not the dropdown when I say horizontal and vertical)

  5. #5
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't know if you've seen this one: Suckerfish dropdowns over at HTML Dog. Fast, lightweight, really easy to implement and standards-compliant - can't recommend it enough.

  6. #6
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes ,it happen to me at the same situation, i think the firefox is not good to support the DOM standard, not the CSS .
    Because DOM is from Microsoft company's research
    I'm glad to communicate technology of computer

  7. #7
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by yorsal
    yes ,it happen to me at the same situation, i think the firefox is not good to support the DOM standard, not the CSS .
    Because DOM is from Microsoft company's research
    Firefox has much better DOM support than IE! IE has very poor support. See my "eight years behind the standards" link below and look at IEs DOM support compared to Firefox.

  8. #8
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And just to add insult to injury, Microsoft even admitted it (though I do concede that they did so in a rather round-about way).


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
  •