如何使用jquery animate()函数旋转图像?

如何使用jquery animate()函数旋转图像?,jquery,Jquery,我知道有很多方法可以旋转图像,包括使用CSS3和jquery。我已经尝试了每一种方法。 所有这些方法都不能解决我的问题。事实上,正如我在标题中提到的,我正在寻找一种方法来旋转我的图像,使其具有良好的放松或效果。我已经尝试过类似的方法,我知道它不起作用,也不起作用 $("document").ready(function() { $("#myImage").hover(function(){ $(this).animate({transform:"rotate(27deg)

我知道有很多方法可以旋转图像,包括使用CSS3和jquery。我已经尝试了每一种方法。 所有这些方法都不能解决我的问题。事实上,正如我在标题中提到的,我正在寻找一种方法来旋转我的图像,使其具有良好的放松或效果。我已经尝试过类似的方法,我知道它不起作用,也不起作用

$("document").ready(function() {
    $("#myImage").hover(function(){
        $(this).animate({transform:"rotate(27deg)"},500,'easeInExpo')
        },function(){
        $(this).animate({transform:"rotate(-27deg)"},500,'easeOutExpo')
    })
});

伙计们,请帮帮我。我找不到一个好的答案。

从你们的帖子中,我看到你们尝试了css,但没有成功,这很有效:

#MyImage{
    width: 100px;
    height: 100px;
    background: limegreen;
    transition: transform 0.5s;
}
#MyImage:hover{
    transform: rotate(27deg);
}

<div id="MyImage"> Hi there </div>