How do I set the values to the callback function, so that it's saved and ready to fire when the element is clicked?
for (i=0; i < ELEMENTS-1; i++) {
array[i].click(function(){
array[i].insertAfter(array[i+1]);
//other stuff
});
}
array[]
just contains a bunch of divs.
<div class="wrapper">
<div id="one" class="tile">One</div>
<div id="two" class="tile">Two</div>
<div id="three" class="tile">Three</div>
<div id="four" class="tile">Four</div>
</div>
When a div is clicked, I want it to move down the list.