jquery - Jssor - Changing container background color when image changes -
i using jssor image slider , working perfectly. question is, there way change background color of container image changes? there attribute needs added option section in js?
any info related matter appreciated. thank time.
there 2 ways work.
a. manually set background color each slide
<div style="background-color: green;"><img u="image" src="image1.jpg" /></div> <div style="background-color: blue;"><img u="image" src="image2.jpg" /></div>
b. place jssor slider in container, , change background-color when slide changed.
jssor_slider1.$on($jssorslider$.$evt_park, function (slideindex, fromeindex) { if (slideindex == 0) { //change container background color green } else if (slideindex == 1) { //change container background color blue } });
Comments
Post a Comment