[英] get background image URL jQuery
change background image with jquery
jQuery(document).ready(function($) {
$('.bg-image').css("background-image", "url('myurl.jpg')");
});
jquery set style background image
$('myObject').css('background-image', 'url(' + imageUrl + ')');
jquery add style background-image
$('myObject').css('background-image', 'url(' + imageUrl + ')');
get background image URL jQuery
jQuery('selector').css('background-image'); // gets the image URL
jQuery('selector').css('background-image', 'path/to/image.jpg'); // sets the image URL