Jquery animate while hover -
i'm looking basic feature: want animate div in it's position while mouse hovers on area of window. i've figured out how , when fire off animate function problem is, it's limited in time. i'm looking way move div relative it's position while hovering.
cheers, janik
edit:
i've created jdfiddle. didn't know before. jsfiddle.net/ru2mz/7 render out problem: want continuous movement or animation of object while mouse on button. basic animation $('#id').animate({left: 100},100) wouldn't work since it's limited fixed end position , fixed amount of time.
$('#somediv').bind('mouseenter', function () { this.iid = setinterval(function () { anidiv(); }, 25); }).bind('mouseleave', function () { this.iid && clearinterval(this.iid); }); function anidiv() { $('#somediv').animate({ marginleft: '-=200px' },10); };
Comments
Post a Comment