Skip to content

Instantly share code, notes, and snippets.

@adhoch
Created May 18, 2017 22:03
Show Gist options
  • Save adhoch/21f0d985057263e6713ef5c21f2b146a to your computer and use it in GitHub Desktop.
Save adhoch/21f0d985057263e6713ef5c21f2b146a to your computer and use it in GitHub Desktop.
$(".description-truncate").mouseenter(function() {
console.log('hit');
tile = $(this).closest('.tile-container');
if(!tile.hasClass('.tile-container-sketchpad')){
clone = $(tile).clone();
$(clone).attr("id",clone[0].id + "-clone"); // just in case we need this later, let's change the id
$(clone).addClass('tile-expand-clone');
$(clone).find(".title").css({"color":"#ca062c"});
$(clone).css({"position":"absolute"}); // important! position it absolute first!
$(clone).css($(tile).position()); // position the clone directly in front of the this tile
$(clone).bind("mouseleave", function() { // remove the clone on mouseLeave
$(this).remove();
// $('.tile-expand-clone').remove();
})
$(".resource-list").append(clone); // add it the tiles
//$(clone).find(".description-full").animate({height: "100%"}, 250);
$(clone).css('height', "100%");
x=$(clone).find('.tile-body').outerHeight();
y=$(clone).find('.taxonomy').outerHeight();
z=x+y;
$(clone).find(".description-full").css('height', "100%");
$(clone).find(".description-full, .tile-body").css({height: z+'px'});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment