variables - jQuery dynamic var change and dynamic if else checking -


i want create var changes it's value on click , want check value of var using if , preform series of animations. if value of var isn't lets projects use else reverse animations.

var url = "work";  if (url == "home") { $("#homebox").fadein(200) }  $("#hometab").click(function(){ var url = "home" }) 

i use one-page website var values urls.

thanks

if understood need, solve it:

var url = "work";  function animate(){   if (url == "home") {     $("#homebox").fadein(200);   } } animate();  $("#hometab").click(function(){   url = "home";  //i removed 'var', because create local variable.   animate(); //perform animation/deanimation }) 

hope helps. cheers


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -