PDA

View Full Version : Image Rotation in Javascript



rbkumar
08-14-2014, 07:57 AM
Dear All,

Help me out, i am a newbie to java script.....trying to do image rotation using java script, but not working in IE8 & Chrome 32.0.

Getting following Error in IE8: Object Expected: Jquery is undefined.

In Chorme 32.0 : Uncaught ReferenceError: $ is not defined (anonymous function)



<!DOCTYPE html>
<html >
<head>
<script type= "text/javascript" src= "./jQueryRotate.js"></script>
<style>
#image{
margin:100px 100px;
}
</style>

<img src= "./logo3w.png" id= "image">
<script type="text/javascript">
var rotation = function (){
$("#image").rotate({
angle:0,
animateTo:360,
callback: rotation,
easing: function (x,t,b,c,d){ // t: current time, b: begInnIng value, c: change In value, d: duration
return c*(t/d)+b;
}
});
}
rotation();
</script>

</head>
</html>

Kindly help me out in resolving this issue.

Thanks in Advance.

Regards,
RBK

Deadweight
08-26-2014, 04:53 PM
First of all it seems like you are missing the jquery file:
http://jquery.com/download/