Forum Replies Created

  • Letizia Margo

    August 23, 2011 at 1:12 am in reply to: Jquery – Image following mouse on a pivot/axel

    I tried following the instructions in that link but it wouldn’t rotate… Did I do it wrong? Is there anything else I should be adding in the code other than this? I added a link to jquery just in case but it still wouldn’t work.

    $(document).ready(function() {

    var img = $('.image');
    if(img.length > 0){
    var offset = img.offset();
    function mouse(evt){
    var center_x = (offset.left) + (img.width()/2);
    var center_y = (offset.top) + (img.height()/2);
    var mouse_x = evt.pageX; var mouse_y = evt.pageY;
    var radians = Math.atan2(mouse_x - center_x, mouse_y - center_y);
    var degree = (radians * (180 / Math.PI) * -1) + 90;
    img.css('-moz-transform', 'rotate('+degree+'deg)');
    img.css('-webkit-transform', 'rotate('+degree+'deg)');
    img.css('-o-transform', 'rotate('+degree+'deg)');
    img.css('-ms-transform', 'rotate('+degree+'deg)');
    }
    $(document).mousemove(mouse);
    }
    });

    Thank you.

  • Letizia Margo

    August 22, 2011 at 5:11 am in reply to: Jquery – Image following mouse on a pivot/axel

    Yes! That’s it!! Thanks for your help 😀

  • Letizia Margo

    August 21, 2011 at 6:27 am in reply to: Ecommerce Websites

    Also, try Presta Shop or Cube Cart. I think they’re really easy to use and Presta Shop is free.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy