0

相当新的 jQuery 无法解决如何让 jQuery 传输在悬停上工作。

$(".rotate").hover(function(){
    $(this).transition({
      perspective: '100px',
      rotateY: '180deg'
    });
});

这将返回“Uncaught TypeError: Property '$' of object [object Object] is not a function”,我已经搞砸了一段时间,但似乎在绕圈子。

如果有人能指出我正确的方向,我将不胜感激。

谢谢弗兰克

4

3 回答 3

1

CSS 在各方面都更好:

.rotate {
    transition: transform 0.4s ease;
    perspective: 100px;
}
.rotate:hover {
    transform: rotateY(180deg);
}

只是在说' ;)

于 2014-02-23T14:27:56.487 回答
0

您的代码似乎运行良好,我只是快速将其放入小提琴中......您确定包含 jQuery 和 transit.js 库吗?

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="http://ricostacruz.com/jquery.transit/jquery.transit.min.js"></script>
<style type="text/css">
  .rotate{ width:50px; height:50px; background-color:lightgrey; border:1px solid #000;  }
</style>
<div class='rotate'></div>    
<script type="text/javascript">
  $(".rotate").hover(function(){
    $(this).transition({
      perspective: '100px',
      rotateY: '180deg'
    });
  });
</script>
于 2014-02-23T14:39:56.683 回答
0

我让它工作了,它最终成为了 jquery 的 wordpress 版本

看到这里jQuery Uncaught TypeError: Property '$' of object [object Window] is not a function

感谢您的帮助!

于 2014-02-23T15:33:08.703 回答