javascript - how to get animation automatically on loading the page -


i want make images effect automatically when page loads. right using code js

$(window).ready(function(){ $(pin).click(function(){   $("#pin01").show().animate({left: '650px'}); }) }); 

and html

<p id="pin">click me</p> <img src="mission.gif" id="pin01" style=" display:none;position:absolute;top:300px;left:300px" /> 

when click button animation occurs. how can make possible animation automatically after page load without button?

simply put animate line within ready or load handler depending on exact needs

$(document).ready(function(){     $("#pin01").show().animate({left: '650px'}); }); 

or

$(widnow).load(function(){     $("#pin01").show().animate({left: '650px'}); }); 

the document.ready event occurs when html document loaded , dom ready. window onload event occurs when dom ready frames, images, etc have been loaded.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -