Created
March 23, 2012 12:55
-
-
Save pdewouters/2170433 to your computer and use it in GitHub Desktop.
add class to images for the drop shadow effect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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