Last active
August 30, 2016 11:12
-
-
Save koentjuh1/9f8518803fe53ff0cf4cd7afebb61edc to your computer and use it in GitHub Desktop.
Replace image of <img> into css: background-image:url(''); to the parent.
This file contains 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
$('.slider-block img').each(function() { | |
var imgSrc = $(this).attr('src'); | |
$(this).parent().css({'background-image': 'url('+imgSrc+')'}); | |
$(this).remove(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment