Skip to content

Instantly share code, notes, and snippets.

@JKring
Created July 20, 2012 05:25
Show Gist options
  • Save JKring/3148851 to your computer and use it in GitHub Desktop.
Save JKring/3148851 to your computer and use it in GitHub Desktop.
collage
function collage(id){
var el = "#" + id;
if ($(el).attr('class').indexOf('disabled') != -1){
$("#collage-helper").remove();
$(el).css('z-index', '100');
var lft = $(el).offset().left.toString() + "px";
var tp = $(el).offset().top.toString() + "px";
$(el).css('position', 'absolute');
$(el).css('left', lft);
$(el).css('top', tp);
$(el).animate({ marginLeft: "+=300px", opacity: 0 }, 200 ,
function() {
$(el).hide();
$(el).appendTo("#collage-bin");
$(el).css('z-index', 'auto');
$(el).css('margin-left', '0px');
$(el).css('position', 'static');
$(el).css('opacity', '1');
$(el).removeClass("disabled-tag");
$("#un-" + id).show();
$(el).fadeIn();
});
$.post("/tags/add", { id: id, category: $(el).attr('data-category'), authenticity_token:"<%= form_authenticity_token %>" }, null, "script");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment