javascript - Jquery function does not display animation -


i have created 2 functions allow me use them different css classes.

    var csselement; $(document).ready(function(){       expandbox (".orange");   minimizebox(".orange");  });  function expandbox ($csselement){      //when mouse rolls on       $($csselement).mouseover(function(){           $(this).stop().animate({height:'485px'},{queue:false, duration:600, easing: 'easeoutbounce'})       });      }  function minimizebox ($csselement){      //when mouse removed       $(csselement).mouseout(function(){           $(this).stop().animate({height:'50px'},{queue:false, duration:600, easing: 'easeoutbounce'})       });  } 

however, function expandbox seems work. if hover mouse away .orange element box not contract.

i want these animations appear functions plan use them few times within website. if put code below:

$(document).ready(function(){       //when mouse rolls on       $($csselement).mouseover(function(){           $(this).stop().animate({height:'485px'},{queue:false, duration:600, easing: 'easeoutbounce'})       });      //when mouse removed       $(csselement).mouseout(function(){           $(this).stop().animate({height:'50px'},{queue:false, duration:600, easing: 'easeoutbounce'})       });   }); 

everything seems work ok. there reason why first code not work second 1 does?

thanks,

vnayak

i guess made typo :

$($csselement)  $(csselement) 

thats why doesn't work


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -