The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

jQuery Clock – Rotating division around a radius (proof of concept)

  • von
    # January 1, 2013 at 8:42 pm

    I had this idea for a clock bouncing around in my head for some time now, but finally got around to coding it. Essentially I have a second, minute, and hour ‘div’ that rotates around different radiuses(radii?) of the clock.

    [Rotate jQuery Clock]( “Rotate Clock (jQuery)”)

    **Meat of the functionality here:**
    _$(which).stop().html(“” + show + “”).animate({marginTop: $.sine(((degree-90)*(3.1415/180)))*radius+’px’, marginLeft: $.cosine(((degree-90)*(3.1415/180)))*radius+’px’ }, 250, ‘linear’);_

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed