【发布时间】:2019-10-18 13:19:51
【问题描述】:
我目前正在尝试让 jQuery UI 可排序功能在我的 Android 手机(触摸)上运行。可悲的是,触摸事件在我的手机上不起作用。我什么都试过了。
jQuery("#details-inner").sortable({
handle: ".sort-section-handle",
axis: "y",
placeholder: "sort-placeholder",
update: function (e, r) {
var a = {action: "update_element_position", sec: jQuery(r.item).attr("data-section"), pos: r.item.index()};
jQuery.post(cm_ajaxurl, a)
}
});
jQuery("#details-inner .sort-section-handle").disableSelection();
我已经在 WordPress 中包含了 jQuery UI 和 jQuery UI Touch Punch 来支持移动触摸:
wp_enqueue_script( 'jquery-ui-sortable' );
wp_enqueue_script( 'jquery-touch-punch' );
在电脑上一切正常,但在我的手机上却不行。在手机上,当我尝试按下手柄移动该部分时,它正在滚动页面。知道可能是什么问题吗?也许是把手?
【问题讨论】:
-
有人有想法吗?
-
请在浏览器中查看您的 WP 结果标头。正在使用哪些版本?你也可以提供一个轻量级的例子吗?
标签: jquery wordpress jquery-ui mobile jquery-plugins