• zepto实现h5左滑显示删除按钮


    这个一直报错: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({'5rem'},200,'linear');
    26         $(this).parent('li').siblings('li').find('.item').animate({left:'0'},200).siblings('.addit').animate({'0'},200);
    27       })
    28       $('.item').on("swipeRight",function(){
    29         $(this).animate({left:'0'},200).siblings('.addit').animate({'0'},200);
    30       });
    31       $('.delete').on("tap",function(){
    32         $(this).parent().remove();
    33       });
    34     })
    35   </script>  
    36 </body>
    37 </html>
    View Code
  • 相关阅读:
    使用Silverlight 实现工作流流程定义
    中国国内航线信息的可视化
    笨办法学R编程(5)
    笨办法学R编程(4)
    笨办法学R编程(3)
    香山杯部分WP
    PWNABLE 3x17
    PWNABLE dubblesort
    PWNABLE applestore
    pyc文件修复出题经历
  • 原文地址:https://www.cnblogs.com/wangchufang/p/8063855.html
Copyright © 2020-2023  润新知