我结合了两个(没有嵌套但是底部是嵌套滑块)Jssor滑块和顶部滑块是响应但不是底部滑块。我在响应式编码中将变量更改为唯一名称,但仅在第二个滑块上仍然没有响应性。提示?
答案 0 :(得分:0)
以下代码用于在窗口调整大小时缩放滑块。
//responsive code begin
//you can remove responsive code if you don't want the slider scales while window resizes
function ScaleSlider() {
var bodyWidth = document.body.clientWidth;
if (bodyWidth)
jssor_slider1.$ScaleWidth(Math.min(bodyWidth, 980));
else
window.setTimeout(ScaleSlider, 30);
}
ScaleSlider();
if (!navigator.userAgent.match(/(iPhone|iPod|iPad|BlackBerry|IEMobile)/)) {
$(window).bind('resize', ScaleSlider);
}
//if (navigator.userAgent.match(/(iPhone|iPod|iPad)/)) {
// $(window).bind("orientationchange", ScaleSlider);
//}
//responsive code end
请稍微更改以同时调整两个滑块的大小。
function ScaleSlider() {
var bodyWidth = document.body.clientWidth;
if (bodyWidth) {
jssor_slider1.$ScaleWidth(Math.min(bodyWidth, 980));
jssor_slider2.$ScaleWidth(Math.min(bodyWidth, 980));
}
else
window.setTimeout(ScaleSlider, 30);
}