Rotate background image

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LTCCTL
    New Member
    • Feb 2008
    • 49

    Rotate background image

    Hi all,

    I have an image on a web page. I need to rotate the image in a clockwise direction every second.

    Please let me know how we can do it.

    Regards
    LTCCTL
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    how many rotation steps would you need? every step would need to be a single image and you could replace the image-src according to the requirement ... you may use setInterval() to start the continous call ...

    kind regards

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      To rotate images at an angle, you can use the Canvas object (and a filter for IE). See an example library (uses jQuery).

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        the canvas object is the better solution of course ... but its not supported by older mozilla browsers ... but certainly that shouldn't be a big problem today ;) ... i think i'm one of the last guys that use an old 1.7.13 Moz ... just because we have optimized internal xul-appps for it that we have to port before switching to a newer one ;) ...

        another point is the different handling in IE and the standards compliant browsers ... which is just ugly but even no problem ... because loading a lot of images is ugly too ;) ...

        kind regards

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Yes, for browsers which don't support the Canvas tag or any proprietary filters, you either need separate images, Flash, Java or use server-side code. You can also use a hack like this one, but it's not advisable and will only work for small images anyway.

          Comment

          Working...