- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › 360 spin image on hover?
I have two gear icons, and when you hover over the div I would like for them to spin, I have it working right now using the http://code.google.com/p/jqueryrotate/ code, however, I am getting some odd results, in Firefox the rotation is off center, however, in Google Chrome, Safari and IE it works better, this is the code I am using:
$(document).ready(function()
{
$('#how-it-works').hover(
function()
{
$('#small-gear').rotate({animateTo:360,duration:1500})
$('#large-gear').rotate({animateTo:-360,duration:1500})
}, function()
{
$('#small-gear,#large-gear').rotate({animateTo:0})
});
});
Are there any other cross-browser methods of accomplishing this? I have searched Google but I haven’t had much luck.
You can use CSS animations. Here is the browser support: http://caniuse.com/#search=CSS3%20animation
If you want any help with them just let me know.
I need cross-browser support though, specifically with IE.
Doesn’t work in IE.
Try using the CSS3PIE shim for IE. And to be honest, I don’t bother doing any fancy animations and stuff like that for old IE… just a plain ol’ layout is enough.
Doesn’t look like PIE supports animations, I was hoping there would be a jQuery approach that would work well.
Here is an example