Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else {
- $('.thumb.selected').removeClass('selected');
- $('.preview').animate({height: '0px'}, 150).remove();
- $(this).addClass('selected');
- var img = $(this).find('img');
- var imgHeight = img.attr('height');
- var imgClone = img.clone();
- var endRow = parseInt(m4($(this).prevAll().length+1));
- $('<li class="preview"><div class="caption empty"><a href="#" class="add">Add a caption</a><a href="#" class="edit">This is a caption</a><form class="captionForm"><input type="text" value="This is a caption" /><div class="buttons clearfix"><input type="submit" value="Save" class="button medium blue"><a class="grey medium button" href="#cancel">Cancel</a></div></form></div></li>')
- .insertAfter('.thumb:nth-child(' + endRow + ')')
- .animate({height: imgHeight+'px'},250);
- imgClone.appendTo('.preview');
- }
Add Comment
Please, Sign In to add comment