if statement - Possibly using if-else jquery in order to prevent additional animations -


i'm new jquery , apologize if problem has obvious answer. i've researched on different ways of solving situation end same problem.

i have few webpages linked , use jquery animate menu bar on each page same way.

the page loads menu bar visible , scrolls down portion of visible (i achieved using jquery css bottom value animation). when user hovers on bar, moves it's original (onload) position contents once again visible.

the problem have jquery code on document.ready consecutively move bar down , upon hovering move content up-- so when link clicked , new page loaded, menu bar moves little (due presence of mouse on bar on new page well) instead of first moving way down.

i want functionality on every page, bar moves down partially visible , moves on later interaction.

here code have been using , on breaking down or inserting if-else logic based on div css bottom property or prevent bar moving first moving way down (that executing second part of jquery code before first part).

$('#navigation').stop().animate({bottom: '-50px'}, 1500);  $('#navigation').mouseenter(function() { $('#wrapper').stop().delay(300).animate({bottom: '3em'}, 500); });  $('#navigation').mouseleave(function() { $('#wrapper').stop().delay(300).animate({bottom: '0'}, 500); }); 

to effect think describing, make default style of menu 'closed', mouseenter(doopen), mouseleave(doclose). way page load code handles closing when user changes pages.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -