Open PablooGit opened 2 years ago
It is very easy! We can use flag to work out this problem! My code:
var isLinkTo = 1; var S = new iSlider(document.getElementById('rec-silder'), list, { isAutoplay: 0, isLooping: 1, isOverspread: false, animateTime: 800, plugins: ['dot'], renderComplete: function () { }, onSlideStart: function (e) { isLinkTo = 1; }, onSlide: function (e) { isLinkTo = 0; }, onSlideEnd: function (e) { if (isLinkTo === 1) { window.location.href = "www.baidu.com"; } } });
It is very easy! We can use flag to work out this problem! My code:
var isLinkTo = 1; var S = new iSlider(document.getElementById('rec-silder'), list, { isAutoplay: 0, isLooping: 1, isOverspread: false, animateTime: 800, plugins: ['dot'], renderComplete: function () { }, onSlideStart: function (e) { isLinkTo = 1; }, onSlide: function (e) { isLinkTo = 0; }, onSlideEnd: function (e) { if (isLinkTo === 1) { window.location.href = "www.baidu.com"; } } });