html
1<ul class="shortcut clear"> 2 <li class="first"> 3 <a href="#" class="btn-action"> 4 <img src="images/shortcut1.png"> 5 <p>SAVE</p> 6 </a> 7 </li> 8 <li class="second"> 9 <a href="#" class="btn-action"> 10 <img src="images/shortcut2.png"> 11 <p>FORECAST</p> 12 </a> 13 </li> 14 <li class="third"> 15 <a href="#" class="btn-action"> 16 <img src="images/shortcut3.png"> 17 <p>CREATE</p> 18 </a> 19 </li> 20</ul>
javascript
1$(function(){ 2 $('.second') 3 .on('mouseenter', '.btn-action', function(event){ 4 event.preventDefault(); 5 $(this).find('img') 6 .animate({'opacity':0.5}, 300); 7 }) 8 .on('mouseleave', '.btn-action', function(event){ 9 event.preventDefault(); 10 $(this).find('img') 11 .animate({'opacity':1}, 300); 12 }); 13});
この中にある、、
javascript
1event.preventDefault();
1、これがどこのデフォルト動作をキャンセルしているか分かりません。。。
2、また、どんなデフォルト動作なのかも分かりません。。。
以上、2点を教えていただきたいです。
よろしくお願い致します。
回答1件
あなたの回答
tips
プレビュー