Home > DeveloperSection > Forums > jQuery Rotate Image Not On Center
Takeshi Okada
Takeshi Okada

Total Post:89

Points:629
Posted on    May-03-2013 3:02 AM

 JQuery JQuery 
Ratings:


 1 Reply(s)
 1866  View(s)
Rate this:
Hi Mindstickians!

I'm having a bit of an issue trying to rotate an image on a particular point.

I've been using http://jsfiddle.net/YKj5D/ as an example; which works perfectly when wanting to rotate an image from its center point.

However, using the example above, i wanted to rotate the image around the letter G, how could this be achieved?

Current code:

function rotateGearStick()
{
var rotation = function (){
       $("#gear-stick").rotate({
          angle:0, 
          animateTo:110, 
       });
    }
    rotation();
}
Where gear-stick is the ID of my image.

I'm attempting to create an rev counter dial.

Thanks in advance!



AVADHESH PATEL

Total Post:604

Points:4228
Posted on    May-03-2013 9:11 AM

Hi Takeshi!

You can try as following

#image{
    margin:100px;
    padding-left:170px; /* <----- */
}

Don't want to miss updates? Please click the below button!

Follow MindStick