jQuery 框架排序小工具 dragsort

Ms-PL
JavaScript
跨平台
2013-12-24
滔哥

dragsort 是一个 JavaScript 文件,允许用户在 jQuery 框架上通过拖拽来来做列表排序。

用法:

$("ul").dragsort({ dragSelector: "li", dragEnd: function() { }, 
dragBetween: false, placeHolderTemplate: "<li></li>" });
$("ul").dragsort("destroy");

dragSelector:The CSS selector  of the element inside the list item to act as the drag handle. The default is the list item itself e.g. LI.
dragSelectorExclude:The css selector of the elements inside the dragSelector to not trigger dragsort. The default is "input, textarea".
itemSelector:The css selector of the list items that are moveable. Will only match elements that are immediate children of list container. The default is tag name of first child e.g. LI.
dragEnd:The callback function that will be called after the dragging has ended (only called if the list order has changed). The keyword "this" in function will refer to list item that was dragged.
dragBetween:Set to "true" if you want to enable the ability to drag between selected lists or to allow dragging of the list item outside of the list for auto scroll. The default is false.
placeHolderTemplate:The html of the place holder for the dragged item. The default is empty list item e.g."<li></li>".
scrollContainer:The css selector of the element you want to scroll (i.e. div with overflow set to auto) when the list item is dragged outside the list. The default is window.
scrollSpeed:A number that represents the speed that the page will scroll when dragging an item outside the scroll container, a higher value is faster and a lower value is slower. Set to 0 to disable scrolling. The default is 5.


加载中

评论(0)

暂无评论

暂无资讯

暂无问答

分享10个使用简单的jQuery的拖放插件(drag and drop plugin)

日期:2012-4-20 来源:GBin1.com 在这篇文章中,我们将给大家介绍10个使用简单的拖放插件,能够方便快捷的帮助你添加拖放功能到你的网站。谢谢! Drag n Drop Scattered Gallery 支持不同外...

2012/04/24 15:42
311
0
总结几个关于 jQuery 用法

#### 有关 jquery 用法 #### 目录: - $.trim() - $.inArray() - $.getJSON() - 事件委托 on - 遍历closest() - ajaxSubmit() - 拖拽排序 dragsort() #### 进入正文 ing... ##### 1. jQuery...

2018/04/13 17:35
414
0
jQuery插件写法总结以及面向对象方式写法总结

最近在折腾jQuery插件,写成插件的目的就是为了实现功能与项目相分离,使得这个代码在下一个项目中能直接引用不出错。这使得我们在写插件的时候,就得考虑清楚,怎么写才能使得插件能够通用、...

2014/12/10 14:10
178
0

没有更多内容

加载失败,请刷新页面

没有更多内容

返回顶部
顶部