php - Wordpress menu-item-hover -


i'm trying create custom drop down menu.

my code looks like:

<div id="header"> </div>        <div class="layer1_col">         <?php wdg::displaymenu('main'); ?>       </div>        <div class="programmingtable"></div>       <div id="main"> 

the wdg::displaymenu('main'); generates menu created in wordpress backend called "main", obviously. theres no changing wdg because need use it.

and i'm trying edit menu-item-12, when edit site in chrome how menu build( that's how got menu-item-12).

<ul id="menu-main" class=""><li id="menu-item-96" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-96"><a href="http://jouwfm.100200.nl/">nieuws</a></li> <li id="menu-item-103" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-103"><a href="http://jouwfm.100200.nl/archief/">archief</a></li> <li id="menu-item-12" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-12"><a>programmering</a></li> <li id="menu-item-97" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-97"><a href="http://jouwfm.100200.nl/vacatures/">vacatures</a></li> <li id="menu-item-102" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-102"><a href="http://jouwfm.100200.nl/adverteren/">adverteren</a></li> <li id="menu-item-27" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-27"><a href="http://jouwfm.100200.nl/contact/">contact</a></li> </ul> 

whereas menu-item-12 isn't real menu item. has no link connected it, div ( .programmingtable) going filled different posts, thats aside of question).

my css looks like:

.programmingtable{   display:none;   margin-left: 10px;   margin-right: 10px;   padding: 0;   height: 380px;   line-height: 1.5em;   background-color: #e3e3e3;   position: absolute;   z-index: 5;   width: 934px;   top: 87px;   padding-left: 8px;   padding-right: 8px;   padding-top: 45px;   border-bottom-left-radius: 8px;   -moz-border-bottom-left-radius: 8px;   border-bottom-right-radius: 8px;   -moz-border-bottom-right-radius: 8px;   -webkit-box-shadow: 0 7px 9px rgba(50,50,50,0.41);   -moz-box-shadow: 0 7px 9px rgba(50,50,50,0.41);   box-shadow: 0 7px 9px rgba(50,50,50,0.41);   background: -webkit-gradient(linear,0% 0,0% 90%,from(#d9d9d9),to(#fbfbfb));   background: -webkit-linear-gradient(top,#d9d9d9,#fbfbfb);   background: -moz-linear-gradient(top,#d9d9d9,#fbfbfb);   background: -ms-linear-gradient(top,#d9d9d9,#fbfbfb);   background: -o-linear-gradient(top,#d9d9d9,#fbfbfb); }  #menu-item-12:hover .programmingtable{   display:block; } 

also tried using opacity, z-index. z-index work rest of div's arent same colour. doesn't right.

i've tried use jquery make happen using this:

  jquery('#menu-item-12').mouseover(      jquery(document).ready( function() {       jquery('.programmingtable').fadein(200)     })   );   jquery('#menu-item-12').mouseleave(      jquery(document).ready( function() {       jquery('.programmingtable').fadeout(200)     })   ); 

this doesn't work. half guess. makes item fade in , fade out again, once on pageload. doesn't when hovering on div in question.

i've been stuck on problem few days now, appreciated.

a better example on mean on this site hover on "programmering".

edit: here's class on displaymenu

 static public function displaymenu( $name, $atts=array( )) {   // getting/setting variablen   extract( shortcode_atts( array( 'container'      => 'div',                                   'containerid'    => '',                                   'containerclass' => '',                                   'menuid'         => '',                                   'menuclass'      => '',                                   'afterlabel'     => '',                                   'beforelabel'    => '',                                 ), $atts          ));    wp_nav_menu( array( 'menu'            => $name,                       'menu_id'         => $menuid,                       'menu_class'      => $menuclass,                       'link_before'     => $beforelabel,                       'link_after'      => $afterlabel,                       'container'       => $container,                       'container_id'    => $containerid,                       'container_class' => $containerclass,                     )); } 

i'm pretty sure jquery code work.

was called in .ready event ?

also, have used .mouseenter event.

jquery(document).ready(function() {     jquery('#menu-item-12').mouseenter(function() {         dosomething();     }).mouseleave(function() {         dosomethingelse();     }); }) 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -