How to change the background image of a block I have four buttons- pressing one button should change the background image with animation like (Fadein or fadeout). I have used this code its changing the background but how to add animation.
jQuery(document).ready(function($){
$('#i1').on({
'click': function(){
$('#change-image').css("background-image", "url('../Zelos/img/e1.jpg')");
}
});
$('#i2').on({
'click': function(){
$('#change-image').css("background-image", "url('../Zelos/img/e2.jpg')");
}
});
$('#i3').on({
'click': function(){
$('#change-image').css("background-image", "url('../Zelos/img/e3.jpg')");
}
});
$('#i4').on({
'click': function(){
$('#change-image').css("background-image", "url('../Zelos/img/e4.jpg')");
}
});
});