Skip to content

Instantly share code, notes, and snippets.

@andyf-7
Created May 3, 2015 11:06
Show Gist options
  • Save andyf-7/0b0d59645b0fc4be6a82 to your computer and use it in GitHub Desktop.
Save andyf-7/0b0d59645b0fc4be6a82 to your computer and use it in GitHub Desktop.
jquery div move left or right
if(e=="moveleft")
{
var $current = $('#tsi'+shhetid).closest('li');
var $previous = $current.prev('li');
if($previous.length !== 0)
{
$current.insertBefore($previous);
}
return false;
}
else if(e=="moveright")
{
var $current =$('#tsi'+shhetid).closest('li');
var $next = $current.next('li');
if($next.length !== 0){
$current.insertAfter($next);
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment