Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chered/e65ead2e208be48ba151f653dd0192a8 to your computer and use it in GitHub Desktop.
Save chered/e65ead2e208be48ba151f653dd0192a8 to your computer and use it in GitHub Desktop.
(function($) {
// store the image link inside a variable from 'src' attribute
var getImageSrc = $('.banner-front-left .fl-post-grid-image img').attr('src');
// add div background image using the variable above
$('.banner-front-left .fl-post-grid-image').css('background-image', 'url(' + getImageSrc + ')');
// store the image link inside a variable from 'src' attribute
var getImageSrc = $('.banner-top-right .fl-post-grid-image img').attr('src');
// add div background image using the variable above
$('.banner-top-right .fl-post-grid-image').css('background-image', 'url(' + getImageSrc + ')');
// store the image link inside a variable from 'src' attribute
var getImageSrc = $('.banner-bottom-left .fl-post-grid-image img').attr('src');
// add div background image using the variable above
$('.banner-bottom-left .fl-post-grid-image').css('background-image', 'url(' + getImageSrc + ')');
// store the image link inside a variable from 'src' attribute
var getImageSrc = $('.banner-bottom-right .fl-post-grid-image img').attr('src');
// add div background image using the variable above
$('.banner-bottom-right .fl-post-grid-image').css('background-image', 'url(' + getImageSrc + ')');
$('.banner-front .fl-post-grid-image img').remove();
})( jQuery );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment