こちらを参考にしてマウスオーバーで画像を回転させようとしているのですが、うまくいきません
index.jsのrotate関数のところでrotate is not functionとエラーも出ます
どの部分で間違っているのでしょうか
よろしくお願いします
html
1<!DOCTYPE html> 2<html lang="en"> 3<head> 4 <meta charset="utf-8"> 5 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 6 <link href='index.css' rel='stylesheet' type='text/css'> 7 <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script> 8 <script type="text/javascript" src="js/jquery.rotate.js"></script> 9 <script type="text/javascript" src="js/index.js"></script> 10 </style> 11</head> 12<body> 13 <img src="flatty/theme/assets/img/imgBasketball.png" width="180" alt=""> 14 15 <script> 16 initialize(); 17 </script> 18</body> 19</html>
js
1function initialize() { 2 $("img").rotate({ 3 bind: 4 { 5 mouseover: function () { 6 $(this).rotate({ 7 animateTo: 360 8 }) 9 }, 10 mouseout: function () { 11 $(this).rotate({ 12 animateTo: 0 13 }) 14 } 15 } 16 }); 17 18} 19
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。