移动端滑动显示删除
请用手机浏览器测试
XML/HTML Code
- <div class="session-box">
- <div style="display:none" class="catid"><?php echo $row["id"]?></div>
- <div class="session-content"> <?php echo $row["name"]?></div>
- <a href="javascript:;" class="del-btn">删除</a>
- <div class="clear"></div>
- </div>
JavaScript Code
- <script>
- $(".session-box").slide2del({
- sItemClass: ".session-box",
- sDelBtnClass: ".del-btn",
- delHandler: function (target) {
- var text = target.find('.session-content').text();
- var cartid=target.find('.catid').text();
- //alert(cartid);
- $.post("del.php", {
- id: cartid,
- });
- target.remove();
- alert(text+"成功删除");
- },
- itemClickHandler: function (target) {
- console.log("你点击了选项:" + target.text());
- // return false;//阻止默认事件
- // $(this).slide2del_hideDel();
- }
- });
- </script>
原文地址:http://www.freejs.net/article_jquerywenzi_655.html