JQuery UISortable 在 iPad 上运行良好,但列表中的正常链接现在失败
我遇到了一个问题,jQuery UI 可排序无法在 iPad/iPhone 上运行我的记录列表。我在每条记录前面都有[编辑]和[删除]链接,ui-sortable的问题通过 http://furf.com/exp/touch-punch/sortable.html,这只是包含一个将触摸事件重新映射到鼠标事件的js文件。现在工作正常了,新问题现在我无法点击列表中每条记录前面的[编辑]或[删除]链接。有人可以帮忙吗? <代码>
var fixHelper = function (e, ui) {
ui.children().each(function () {
$(this).width($(this).width());
});
return ui;
};
$(document).ready(function () {
$(function () {
$("#dynamicsortlists tbody").sortable({
opacity: 0.6,
helper: fixHelper,
cursor: 'move',
update: function () {
var order = $(this).sortable("serialize") + '&action=updateRecordsListings';
$.post("_changesortorder.php", order, function (theResponse) {
});
}
});
});
当它不适用于 iPad 时,我只包含来自 http://furf.com/exp/touch-punch/sortable.html。 这有效,但现在 #dynamicsortlists tbody tr 中的正常链接不起作用。
编辑: 好吧,没有人回答,现在另一个问题,可能很容易。 现在请查看 http://jqueryui.com/demos/sortable/ 的默认功能示例我不希望单击整个“li”向上/向下移动,我想要“li”中带有一个特定图标,并且只有“li”可以从该图标向上/向下移动。请帮我解决这个问题。
I had a problem that jQuery UI sortable was not working on iPad/iPhone for my record list. I have [edit] and [delete] links in front of each record, the problem of ui-sortable is fixed by http://furf.com/exp/touch-punch/sortable.html, that was just to include one js file that remap touch events to mouse events.Now that works fine, the new problem now is that I can't click the [edit] or [delete] links in front of each record in the listing. Can any one help please?
var fixHelper = function (e, ui) { ui.children().each(function () { $(this).width($(this).width()); }); return ui; };$(document).ready(function () {
$(function () { $("#dynamicsortlists tbody").sortable({ opacity: 0.6, helper: fixHelper, cursor: 'move', update: function () { var order = $(this).sortable("serialize") + '&action=updateRecordsListings'; $.post("_changesortorder.php", order, function (theResponse) { }); } }); });
When it was not working for iPad, I just include this jquery file jquery.ui.touch-punch.min.js from http://furf.com/exp/touch-punch/sortable.html.
And that worked, but now normal links in #dynamicsortlists tbody tr are not working.
Edit :
Okay, No one answered, now another issue, may be that is easy.
Please look at http://jqueryui.com/demos/sortable/ with the Default Functionality example, now I don't want the whole "li" to be clicked moved up/down, I want a specific icon with in the "li" and only the the "li" can moved up/down holding from that icon. Please help me with this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
jquery-ui-touch-punch 0.2 版本解决了 Github 上记录的所有问题,包括可排序小部件内部链接的问题。尝试再次下载并查看是否可以解决您的问题。如果没有,请使用示例代码和 $/$.ui 版本提出问题,我将尝试修复它。
https://github.com/furf/jquery-ui-touch-punch
The 0.2 release of jquery-ui-touch-punch resolved all issues logged against it on Github, including one where links inside of a sortable widget. Try downloading again and see if it fixes your issue. If not, file an issue with sample code and versions of $/$.ui and I will try to fix it.
https://github.com/furf/jquery-ui-touch-punch
我不知道这对您来说是否仍然感兴趣,但是启用处理程序的工作方式就像对可拖动对象一样...对于轴来说也是如此...
$( "#sortbox" ).sortable({
句柄:'.draghandle',
轴:'y'
});
然而..这会产生另一个问题。一旦通过手柄拖动,当您单击手柄以外的任何位置时,最后排序的项目会四处移动。
punch-touch 是一个非常酷的插件,但它有很多问题,令人遗憾的是,没有太多响应或修复。
I don't know if this is still interesing for you but enabling a handler works just as it does for draggables... same for the axis...
$( "#sortbox" ).sortable({
handle:'.draghandle',
axis:'y'
});
Yet.. this creates another issue. once dragged by a handle, the last sorted item moves around when you click anywhere but a handle.
punch-touch is a really cool plugin, but it has quite some issues and it is very sad, that there are not many responses or fixes.