jQuery draggable sortable , get the after sort result.

July 22, 2012   ·   0 Comments

Screen Shot 2012-07-21 at 9.55.10 PM

 


 

 
<ul id="RSS_sortable">
<?php for($i=1;$i<=5;$i++){ ?>
 <li class="ui-state-default drag" id="<?php echo $i; ?>" style="margin:10px; padding:10px">
 <!-- RSS -->
 email:
 <input name="email to us: " type="text" value="email to us" size="20" > email address:
 <input name="email_address" type="text" value="support@looptek.com" size="20">


 <span class="ui-icon ui-icon-trash" style="float:right" >Delete </span>
 </li>

<?php } ?>

</ul>

&nbsp;

&nbsp;
<script type="text/javascript">
$( "#RSS_sortable" ).sortable({
 revert: true,
 axis:'y',
 update:function(event, ui){
 var t1 = $(this).sortable('toArray').toString();


 // pos = $(ui.item).attr("id");
 // alert(pos);
 // alert($(ui.item).text());
 // t1=$('ul.li:nth-child(0)').attr("id");
 alert(t1);


 }
 });
 $( "#draggable" ).draggable({
 connectToSortable: "#RSS_sortable",
 helper: "clone",
 revert: "invalid"
 });
 $( "ul, li" ).disableSelection();

</script>

shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
jQuery172

jQuery

Amazon

adsbygoogle

Recent Posts

Categories

Amazon