这是一个自我问答
我已经与惊人的CarouFredSel滑块插件开发了很长时间。每次我必须做一个全屏幕幻灯片,需要响应的宽度和高度,我忘记了如何做。因此,我为我和所有与此作斗争的其他人做了这个问答。
因此,这里有一个问题:
如何制作全屏响应的CarouFredSel幻灯片?
发布于 2014-03-17 17:31:32
关键是在启动CarouFredSel之前调整幻灯片的大小,然后在窗口调整大小时刷新图库和幻灯片大小。当我加入CarouFredSel时,要注意高度和响应参数。
function sizeGallery(){
// Set size of slides and gallery
var winHeight = jQuery(window).height();
var winWidth = jQuery(window).width();
jQuery('.gallery, .gallery .slide').width(winWidth).height(winHeight);
}
function startGallery() {
// Start carouFredSel as a Fullscreen slideshow
jQuery('.gallery').carouFredSel({
circular: true,
infinite: true,
responsive: true,
height: 'variable',
scroll: {
items: 1
},
items: {
visible: 1,
height: 'variable'
}
});
}
jQuery(document).ready(function(){
sizeGallery();
startGallery();
});
jQuery(window).resize(function(){
sizeGallery();
jQuery('.gallery').trigger('updateSizes');
});https://stackoverflow.com/questions/22461244
复制相似问题