SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: jQuery Rotate

Hybrid View

  1. #1
    SitePoint Enthusiast Ciwan's Avatar
    Join Date
    May 2010
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jQuery Rotate

    Hello Wise JS People

    I am very new to jQuery & JavaScript and I would greatly appreciate some help. Basically I have an <li> element with id { #about } and I want it slightly rotate as a user triggers a mouseover event.

    Here's my code:

    Code:
    $(document).ready(function(){
       $("#about").mouseover(function(event){
    		// rotate slightly
       });
     });
    The problem is I do not know how to make it rotate. I looked on the jQuery site, and there wasn't a rotate function.

    I would greatly appreciate any help.

    Thank You.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    CSS3 is how you perform the rotation, using moz-transform and webkit-transform
    http://www.webdesignerdepot.com/2009...can-use-today/

    A patch to jQuery allows you to use .animate() to perform an animated rotation too.
    jQuery Patch: Animate CSS Rotation and Scale
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast Ciwan's Avatar
    Join Date
    May 2010
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Paul. I've decided to go with the CSS3 method. It seems easier.

    Thank You ever so much.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •