¡@

Home 

2014/10/16 ¤W¤È 12:04:29

jquery Programming Glossary: item.data

Simplest way to get current item index within jQuery template

http://stackoverflow.com/questions/3895329/simplest-way-to-get-current-item-index-within-jquery-template

template you can access the function from the item object script id templateToRender type text x jquery tmpl li Info # item.dataArrayIndex item.data li script Alternatively instead of passing item.data into the function the context of the function is.. the function from the item object script id templateToRender type text x jquery tmpl li Info # item.dataArrayIndex item.data li script Alternatively instead of passing item.data into the function the context of the function is the tmplItem object.. type text x jquery tmpl li Info # item.dataArrayIndex item.data li script Alternatively instead of passing item.data into the function the context of the function is the tmplItem object of the template same as item.data . So you could write..

jQuery Sortable with animation

http://stackoverflow.com/questions/5060357/jquery-sortable-with-animation

absolute positioned counterparts... var item jQuery this var item_clone item.clone 'store' the clone for later use... item.data clone item_clone set the initial position of the clone var position item.position item_clone.css left position.left item_clone.css.. clone and adjust accordingly... jQuery #original_items li.exclude me .each function var item jQuery this var clone item.data clone var position item.position move the clone under the item we've just dropped... clone.css left position.left clone.css.. jQuery #original_items li not .exclude me .ui sortable placeholder .each function var item jQuery this var clone item.data clone stop current clone animations... clone.stop true false get the invisible item which has snapped to a new location..