html - jQuery enable prevent default and toggle an active class for first-child in a list -


two small issues cant seem figure out:

  1. as come on page, allow clicking of thumbnail go different page. when click on button "delete thumbs" not allow user click through, use prevent default. problem when click "done" button, thumbs still not clickable. want re-enable clicking once click "done"

  2. my second issue - if click button "delete thumbs" allow re-arrange order of thumbs using jqueryui sortable.

i have active class in css set on first-child. want active li on first 1 in list. if drag first li out remove active class , first li in list become active one.

.gallery li a.active:first-child  

i have demo code below: http://jsfiddle.net/3e2hg/73/

hope can help,

thanks

dude, first question, here solution.

$(function canceldeleteimages(){     $(".canceldeleteimages").click(function(event) {          $('.canceldeleteimages').hide();          $('.deleteallimages').show();           $( "#sortable" ).sortable("disable");         $('#sortable li a').unbind('click').click();        // return true;     }); }); 

second question, did not understand, can please explain in detail

second solution:

$( "#sortable" ).sortable({             //need allow user able scrollover thumbnails on device             //delay: 900, // touch , hold activate li being sortable             //scroll: true, // allow user scroll on thumbnails             placeholder: "ui-state-highlight",              stop: function(event, ui) {             $('ul#sortable a.active').removeclass('active');         $('ul#sortable a:first').addclass('active');             }         }); 

replace .sortable above. works


Comments