Jquery animate width from left to right -
i trying animate menu elements shrinking width 170 150px on mouseover. problem is, default .animate shrinking happens on right side of rectangle, need shrink on left side. have tried animating left margin, since have text inside element, shifts on right during animation.
this actual code i'm using
$(document).ready(function(){ //when mouse rolls on $("#navigation li").mouseover(function(){ $(this).stop().animate({marginleft:'20'},{queue:false, duration:600, easing: 'easeoutbounce'}) }); //when mouse removed $("#navigation li").mouseout(function(){ $(this).stop().animate({marginleft:'0'},{queue:false, duration:600, easing: 'easeoutbounce'}) }); }); i had found other answers this, didn't understand proposed solution.
this default behavior. way change via css
#navigation li { float: right; //sometimes using float funks things so... } or changing css of parent , child li (better solution)
#navigation_li's_parent { text-align: right; } #navigation li { display: inline-block; }
Comments
Post a Comment