javascript - jquery menu slideshow error -


i making website includes menu navigation identical 1 found @ fotopunch.com instead of pointing down points up. anyways, wrote code using jquery/javascript menu , works there small error occurs @ fotopunch site. when move cursor 1 menu item , repeatedly messes display temporarily. there way fix this? include part of javascript file can see each menu item.

$("div#menu .reps").hover(function() {     //if current slide not reps     if(current_slide != "reps"){     //move arrow corresponding position reps slide          $(".arrow").animate({"left":"135px"});//move arrow         //(test slide is.)         if(current_slide == "clients"){             //fade out & hide current slide             $(".clients_display").fadeout().hide();//hide current slide             //show reps slide & fade in             $(".reps_display").fadein().show();//show slide             //the current slide reps slide             current_slide = "reps";         }         else if(current_slide == "services"){             //fade out & hide current slide             $(".services_display").fadeout().hide();//hide current slide             //show reps slide & fade in             $(".reps_display").fadein().show();//show slide             //the current slide reps slide             current_slide = "reps";         }         else{             //fade out & hide current slide             $(".training_display").fadeout().hide();//hide current slide             //show reps slide & fade in             $(".reps_display").fadein().show();//show slide             //the current slide reps slide             current_slide = "reps";         }     } }); 

i each menu item (there 4). think problem when fades out , fades in because if tries @ same time displaying 2 of menu divs @ same time. tried add timeout unsuccessful. what best way fix error? small enough not big priority nice have work better. thanks.

if(current_slide == "clients"){              $(".clients_display")stop(true, true).fadeout().hide();              $(".reps_display").stop(true, true).fadein().show();              current_slide = "reps";          } else if(current_slide == "services"){              $(".services_display").stop(true, true).fadeout().hide();              $(".reps_display").stop(true, true).fadein().show();              current_slide = "reps";         } else{              $(".training_display").stop(true, true).fadeout().hide();//hide current slide              $(".reps_display").stop(true, true).fadein().show();//show slide           } 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -