jQuery >> Move a section, by searching inner dom



(function($){
    var $val = id;
    var $hasInserted = false;
    $('#Saved .check-column input[type="checkbox"]').each(function(){
            if(parseInt($(this).val(), 10) <= $val && $hasInserted === false){
                     $hasInserted = true;
                      $(this).closest('tr').before($('#msg_new_id_'+id));
             }

      });
      if($hasInserted === false){
              $('#Saved table.table.table-hover tbody').append($('#msg_new_id_'+id));
      }
 })(jQuery);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s