Please, can someone help me, I have a code for an animation but animation cannot start. I cannot see the problem?
For example
JQuery code:
$(document).ready(function(){
$('img').click(function(){
$('img').animate( {left: 600},
'slow', function(){
$('img').fadeTo('slow',0);
$('img').fadeTo('slow',1);
$('img').animate({left: 0}, 'slow');
}
);
});
HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>JQuery Examples</title>
<link rel="stylesheet" href="new3.css" type="text/css" media="screen" />
<script src="jquery-1.4.2.js" type="text/javascript"></script>
<script src="new4.js" type="text/javascript"></script>
</head>
<body>
<h2>Scrolling image</h2>
<img src="cell.jpg" />
</body>
</html>
css code:
img{
position:relative;
}
Thanks in advance