Issue with releasing Webkit edge radius when using -webkit-transform

I made a simple script in jQuery that takes an image and rotates it slowly. Link to an example

     deg = 0;
     derp = false;
     function callRotate(){
      if(!derp){
        setInterval(rotate, 50);
      }
     }
    function rotate(){
      $("#rotate_me > img").css({"-webkit-transform":"rotate("+ deg +"deg)", "-moz-transform":"rotate("+ deg +"deg)"});
    deg+=.2;
    }
    callRotate();

I decided to put the border radius on the div equal to 1/2 the height of the div so that the image looks like a circle. The rotation looks great in Firefox 4.0.1, but when I tested it in Chrome, the image will immediately roll along the boundary radius immediately after the start of rotation. Does anyone know how to prevent image bleeding?

+5
source share
3 answers

You have to make the image the background of the div in CSS, and then rotate the div.

+2
source

border-radius img, Opera ( ).

0

All Articles