在页面加载时,我想动态调整幻灯片的大小,使下面的轮播显示大约2/3,如下图所示:
我不确定从哪里开始。我有这样的事情:
var os=$("#content").offset(); // #content is where the slider lives
var w=$(window).height(); // current 934, for example
var ch=140; // carousel height will always be 140px
var used=os.top+ch; // used 140+292= 492 height left
// what width will fit in 492px high and leave about 2/3 of the carousel visible?
另一件事:在初始页面加载和重新调整滑块大小后,如果调整页面大小,图像需要是动态的。
flexslider init:
$('#slider').flexslider({
animation: "slide",
controlNav: false,
animationLoop: true,
slideshow: false,
sync: "#carousel"
});
$('#carousel').flexslider({
animation: "slide",
controlNav: false,
animationLoop: true,
slideshow: false,
itemWidth: 210,
itemMargin: 5,
asNavFor: '#slider'
});