是否有可能使这个演示http://www.jssor.com/demos/full-width-slider.html到全屏高度?喜欢超大旋转木马http://buildinternet.com/project/supersized/slideshow/3.2/demo.html
谢谢
jss*_*sor 16
请使用以下代码将滑块缩放到全屏,
//responsive code begin
//you can remove responsive code if you don't want the slider scales while window resizes
function ScaleSlider() {
var windowWidth = $(window).width();
if (windowWidth) {
var windowHeight = $(window).height();
var originalWidth = jssor_slider1.$OriginalWidth();
var originalHeight = jssor_slider1.$OriginalHeight();
var scaleWidth = windowWidth;
if (originalWidth / windowWidth > originalHeight / windowHeight) {
scaleWidth = Math.ceil(windowHeight / originalHeight * originalWidth);
}
jssor_slider1.$ScaleWidth(scaleWidth);
}
else
window.setTimeout(ScaleSlider, 30);
}
ScaleSlider();
$(window).bind("load", ScaleSlider);
$(window).bind("resize", ScaleSlider);
$(window).bind("orientationchange", ScaleSlider);
//responsive code end
Run Code Online (Sandbox Code Playgroud)
并包裹滑块容器
<div style="position: relative; width: 100%; overflow: hidden;">
<div style="position: relative; left: 50%; width: 5000px; text-align: center; margin-left: -2500px;">
<!-- use 'margin: 0 auto;' to auto center element in parent container -->
<div id="slider1_container" style="...margin: 0 auto;..." ...>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
请访问带有源代码的全屏滑块.