Skip to content

Instantly share code, notes, and snippets.

@chadsten
Created June 25, 2013 17:08
Show Gist options
  • Select an option

  • Save chadsten/5860301 to your computer and use it in GitHub Desktop.

Select an option

Save chadsten/5860301 to your computer and use it in GitHub Desktop.
jQuery(function($) {
$(document).ready(function() {
$('.view-id-blog .image').hover(function() {
var h = $(this).siblings('.blog-details').height();
var t = $(this).siblings('.blog-details').children('.title').height();
$(this).siblings('.blog-details').animate({
marginTop: -h
}, 300, function() {
});
$(this).parent().siblings().children('.blog-details').animate({
marginTop: -t
}, 200, function() {
});
});
});
$('.view-id-blog .image img').load(function() {
detailSize(this);
});
$(window).on("debouncedresize", function(event) {
detailSize('.view-id-blog .image img');
});
function detailSize(element) {
var h = $(element).height();
var t = $(element).parent().siblings('.blog-details').children('.title').height();
$(element).parent().siblings('.blog-details').height(h).css('margin-top',-t);
$(element).parent().height(h); // hack
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment