Home / Archive / Vertically center Instagram caption on hover
Duplicate Snippet

Embed Snippet on Your Site

Vertically center Instagram caption on hover

This vertically centers the caption that appears on hover inside the post.

Code Preview
js
jQuery(window).on('sbiafterimagesloaded', function (event) {
  $ = jQuery;
  $('.sbi_hover_top').each(function(){
	  var $self = $(this);
	  $self.css({
		'position' : 'absolute',
		'top' : ( $self.parent().height() - $self.height() ) / 2
	  });
	});
})

Comments

Add a Comment