I am trying to make this code work but after trying a lot I am still unable to run it. The image should animate but its not working. Any ideas whats wrong? Thanks
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script type=""
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<style type="text/css">
img
{
position:absolute;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$zombie = $('img#flickr');
function runit(){
$zombie
.animate({ opacity: 1 },100)
.animate({top:'300px',left:'300px'}, {duration:2000})
.animate({top:'260px',left:'340px'}, {duration:2000})
.animate({top:'220px', left:'380px'}, {duration:2000})
.animate({top:'180px', left:'420px'}, {duration:2000})
.animate({top:'140px', left:'460px'}, {duration:2000})
.animate({top:'100px', left:'500px'}, 2000,function(){
runit();
});
}
runit();
});
</script>
</head>
<body>
<!--<img id ="flickr" src="9.png" />
-->
<img id ="flickr" src="http://placekitten.com/g/200/300" />
</body>
</html>
Its working just fine. There is broken
<script type=""in your code, remove it. But it works for mine with that broken tag. If still there is problem, then usefirebugor such type debugger to check error.<script>having code just before</body>, though may be its not an issue.Go to the js code where you call the function
runit();, place cursor after;and pressbackspacekey until it delete the semicolon(;) and save the script, upload it and check again.