Skip to content

Instantly share code, notes, and snippets.

@pdewouters
Created March 23, 2012 12:55
Show Gist options
  • Select an option

  • Save pdewouters/2170433 to your computer and use it in GitHub Desktop.

Select an option

Save pdewouters/2170433 to your computer and use it in GitHub Desktop.
add class to images for the drop shadow effect
jQuery(document).ready(function($){
$('.entry-content img, .wp-caption img').wrap('<div class="drop-shadow" />');
$('.entry-content img').each(function(){
var thisWidth = $(this).width();
var thisClasses = $(this).attr('class');
$(this).removeClass(thisClasses).parent('.drop-shadow').css('width',thisWidth).addClass(thisClasses);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment