Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript 360 spin image on hover?

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #35510
    mikes02
    Participant

    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.

    #92048

    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.

    #92054
    mikes02
    Participant

    I need cross-browser support though, specifically with IE.

    #92066
    mikes02
    Participant

    Doesn’t work in IE.

    #92070
    Mottie
    Member

    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.

    #92075
    mikes02
    Participant

    Doesn’t look like PIE supports animations, I was hoping there would be a jQuery approach that would work well.

    #287424
    Zeeshan Zafar
    Participant

    Here is an example

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.