这个一直报错:on() is not a function
不知道是为何,代码如下:
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <meta name="viewport" id="viewport" content="width=device-width, initial-scale=1"> 6 <title>demo</title> 7 <script src="jquery.min.js"></script> 8 <!-- <script>jQuery.noConflict()</script> --> 9 <script src="zepto.js"></script> 10 <!-- <script src="fx.js"></script> --> 11 <script src="touch.js"></script> 12 <style> 13 .apply{position: relative;zoom: 1;display:block;height:3rem;line-height: 3rem;border-bottom: 1px solid #eee;overflow: hidden;} 14 .addit{position: absolute;top: 0;right: 0} 15 </style> 16 </head> 17 <body> 18 <div class="apply"> 19 <div class="item">内容内容内容内容内容</div> 20 <div class="addit delete">删除</div> 21 </div> 22 <script> 23 $(document).ready(function(){ 24 $('.item').on("swipeLeft",function(){ 25 $(this).animate({left:'5rem'},200,'linear').siblings('.addit').animate({width:'5rem'},200,'linear'); 26 $(this).parent('li').siblings('li').find('.item').animate({left:'0'},200).siblings('.addit').animate({width:'0'},200); 27 }) 28 $('.item').on("swipeRight",function(){ 29 $(this).animate({left:'0'},200).siblings('.addit').animate({width:'0'},200); 30 }); 31 $('.delete').on("tap",function(){ 32 $(this).parent().remove(); 33 }); 34 }) 35 </script> 36 </body> 37 </html>