PDA

View Full Version : jquery rotate don't work



davelf
02-09-2012, 06:56 AM
Hi, i have problem implementing this example to the website:
http://code.google.com/p/jqueryrotate/wiki/Documentation

this is my 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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="jQueryRotateCompressed.2.1.js"></script>
<script>
$(document).ready(function() {
$("#img").rotate(45);
})
</script>
</head>

<body>
<img src="dl_arrow.png" id="img" />
</body>
</html>


any idea, what's wrong with my script? Thanks

hosam
02-09-2012, 02:40 PM
Hi, i have problem implementing this example to the website:
http://code.google.com/p/jqueryrotate/wiki/Documentation

this is my 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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="jQueryRotateCompressed.2.1.js"></script>
<script>
$(document).ready(function() {
$("#img").rotate(45);
})
</script>
</head>

<body>
<img src="dl_arrow.png" id="img" />
</body>
</html>


any idea, what's wrong with my script? Thanks

well your code seems missing parts, as I guess you should first get jquery call then use it, because this one depend on it then apply your rotate script. so check this if its work with you:


<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<!-- you can download it then apply at script or you could just import it from google library
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
-->
<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript" src="jQueryRotateCompressed.2.1.js"></script>
<script>
$(document).ready(function() {
$("#img").rotate(45);
})
</script>
</head>

<body>
<img src="dl_arrow.png" id="img" />
</body>
</html>

davelf
02-10-2012, 02:10 AM
any other idea?

hosam
02-10-2012, 04:47 AM
well you could also try to assign selector to id instead of img:

<script type="text/javascript">
$(document).ready(function() {
$("#i").rotate(45);
})
</script>
</head>

<body>
<img id="i" src="dl_arrow.png" id="img" />
</body>
</html>
hope this help

davelf
02-10-2012, 06:20 AM
Hi hosam, thanks for your reply. But there's nothing happen even i change the "id".

Have you open this site and try it: http://code.google.com/p/jqueryrotate/wiki/Documentation

And is that code you gave me really work, base on what you already try from that site tutorial. Seriously just change the "id"???