Wednesday, January 28, 2015

One tricky infinity time animation by jquery

$(document).ready(function(){
$.fn.grow_anim=function(){
$("#anim").animate({paddingLeft: "100px"}, 1000);
$(this).shrink_anim();
}

$.fn.shrink_anim=function(){
$("#anim").animate({paddingLeft: "15px"}, 1000);
$(this).grow_anim();
}

$("#anim").bind("mouseenter",function(){
$("#anim").stop(true);
});

$("#anim").bind("mouseleave",function(){
$(this).grow_anim();
});
});

I am explaining below:

Normally animation running and running but when you put your mouse on that Div or text in that time animation will be stop then again when you leave your mouse pointer from that div or text your animation will be running normally.

try it good luck.

No comments:

Post a Comment

Change priority of dual boot OS

Change priority of dual boot OS  (Windows and Linux): Go to your Linux OS, install Grub customizer. Then change priority by up and down arro...