background appearing html code example
Example 1: css background image is not show change default picture
var imageURLs = $('div');
imageURLs.each(function(index, element){
var imageURL = $(element).css('background-image').replace('url("', '').replace('")', '');
if (imageURL != "none"){
$.ajax({
url: imageURL,
type: 'HEAD',
error: function(){
//error handling for broken image url
}
});
}
});
Example 2: css background image is not show change default picture
$("html").css({ "background-image": "url('../images/pattern%20copy.png'), url('../images/visuals/visual3-edit.jpg')", "background-position": "center", "background-repeat": "no-repeat", "background-attachment": "fixed" });