说三道四技术文摘-感悟人生的经典句子
说三道四 > 文档快照

Sortable(options)-JQuery API

HTML文档下载 WORD文档下载 PDF文档下载
Sortable(options)允许你通过拖放对容器里的元素重新排序. 需要拖放插件.

Sortable(options)

允许你通过拖放对容器里的元素重新排序. 需要拖放插件. The container and each item inside the container must have an ID. Sortables are especially useful for lists.

 

参数

options (Hash): A hash of options 

Hash 选项

  • accept (String): The class name for items inside the container (mandatory)
  • activeclass (String): The class for the container when one of its items has started to move
  • hoverclass (String): The class for the container when an acceptable item is inside it
  • helperclass (String): The helper is used to point to the place where the item will be moved. This is the class for the helper.
  • opacity (Float): Opacity (between 0 and 1) of the item while being dragged
  • ghosting (Boolean): When true, the sortable is ghosted when dragged
  • tolerance (String): Either 'pointer', 'intersect', or 'fit'. See Droppable for more details
  • fit (Boolean): When true, sortable must be inside the container in order to drop
  • fx (Integer): Duration for the effect applied to the sortable
  • onchange (Function): Callback that gets called when the sortable list changed. It takes an array of serialized elements
  • floats (Boolean): True if the sorted elements are floated
  • containment (String): Use 'parent' to constrain the drag to the container
  • axis (String): Use 'horizontally' or 'vertically' to constrain dragging to an axis
  • handle (String): The jQuery selector that indicates the draggable handle
  • handle (DOMElement): The node that indicates the draggable handle
  • onHover (Function): Callback that is called when an acceptable item is dragged over the container. Gets the hovering DOMElement as a parameter
  • onOut (Function): Callback that is called when an acceptable item leaves the container. Gets the leaving DOMElement as a parameter
  • cursorAt (Object): The mouse cursor will be moved to the offset on the dragged item indicated by the object, which takes "top", "bottom", "left", and "right" keys
  • onStart (Function): Callback function triggered when the dragging starts
  • onStop (Function): Callback function triggered when the dragging stops

示例

jQuery 代码:
$('ul').Sortable( { accept : 'sortableitem', activeclass : 'sortableactive', hoverclass : 'sortablehover', helperclass : 'sorthelper', opacity: 0.5, fit : false } )

《找你妹2》开发者云中游再声明:热酷涉嫌严重违约发布侵权竞品 柴可:大姨吗的轻应用抉择 盘点2013年IT界25个最古怪的面试题 云计算再掀创业热潮,19家企业入驻微软创投 IBM斥资12亿美元,全球大规模扩建数据中心 求教!ftp服务器 装了AD之后,看不到局域网中的工作组电脑`~~ 如何让一个页面自动执行一个url?? 有关视图的问题,在线等。 请教前辈! 请问怎么连接两个BSTR。 tomcat5.0配置的问题? ~~笑话大全2~~~ xp下文件夹加密,重装xp后,打不开了?? be my girl我要的是JYJ,中文歌词,谁能 wake me up is not alarm c wake me up is not alarm c 第三人称单数人称代词的主格和宾格谢谢,请详细一些 用人称代词的主格或宾格填空1.i have a c 谁给我讲一下人称代词主格和宾格的用法 求人称代词,主格,宾格的那个表 《be my satellite》歌词翻译劳烦大 always be my baby这首歌的中文翻译 冀宝斋博物馆馆长离世 馆内藏品被指雷“小产权房”暂无新政 三中全会或迎来嘉兴19岁女子未婚先孕 为保胎拿姐姐省人大调研杭州“治堵” 杭州酝酿再度杭州:市区60方以上新建住宅 最少配李克强邀现场媒体帮小微企业做“广告”河南省环保厅再开大额罚单 6环境违法许昌市一银行职员被捆钞机咬手指 指尖限购取消郑州房产销量上涨 房贷利率偏亳州男子葬礼上砍死两人 警方悬赏万元碌仙落日羽神游戏从诛仙开始斗魔大陆情天宝鉴张家界大峡谷旅游魅力湘西旅游天波府旅游张家界袁家寨子旅游大观台旅游
备案号:鲁ICP备13029499号-2 说三道四 www.s3d4.cn 说三道四技术文摘