Open havingmeaning opened 7 years ago
Example: list.push({ content: `
</a> </div>` });
如果有a标签的话,在我滑动到下一张的过程中,页面直接发生跳转。 其实我想要的效果,就是在我滑动的时候,页面不要应该发生跳转。而页面发生跳转的时候,仅仅只是我点击的时候!
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"; } } });
Example: list.push({ content: `
如果有a标签的话,在我滑动到下一张的过程中,页面直接发生跳转。 其实我想要的效果,就是在我滑动的时候,页面不要应该发生跳转。而页面发生跳转的时候,仅仅只是我点击的时候!
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"; } } });