【发布时间】:2017-03-23 01:51:01
【问题描述】:
毫无疑问它可以工作,但我知道这不是一个好的代码。所以我想完成
-
使用
on()使其工作<script> $(document).on("mouseenter", ".BUTTON_ONE", function() { $(this).animate({ \'padding-right\' : 10, },30); }); $(document).on("mouseleave", ".BUTTON_ONE", function() { $(this).animate({ \'padding-right\' : 4, },30); }); $(document).on("mouseenter", ".BUTTON_TWO", function() { $(this).animate({ \'padding-left\' : 10, },30); }); $(document).on("mouseleave", ".BUTTON_TWO", function() { $(this).animate({ \'padding-left\' : 4, },30); }); $(document).on("mouseenter", ".BUTTON_THREE", function() { $(this).animate({ \'padding-left\' : 10, },30); }); $(document).on("mouseleave", ".BUTTON_THREE", function() { $(this).animate({ \'padding-left\' : 4, },30); }); </script>
【问题讨论】: