javascript
<!doctype html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <title>Document</title> <script src="./zepto.js"></script> </head> <body> <style></style> <ul id="items"> <li>List item 1 <span class="delete">DELETE</span></li> <li>List item 2 <span class="delete">DELETE</span></li> </ul> <script> $(function(){ // show delete buttons on swipe $('.delete').on("tap",function(){ $(this).parent('li').remove() }); $('#items li').swipe(function(){ $('.delete').hide() $('.delete', this).show() }) }) </script> </body> </html>
这段代码会报错,请问tap和swipe在本地浏览器上不行吗?我浏览器是chrome41的
从官网下载的zepto不包含touch模块。你需要定制!
Zepto Builder
选中
