【发布时间】:2015-05-07 09:17:21
【问题描述】:
我正在为标题和图像使用带有淡入淡出效果的 Jssor 内容滑块。 但是,当页面加载时,所有图像都会立即加载到看起来非常糟糕的背景图像上。 我什至对它应用了加载部分,但它有什么不同。
如果有人可以帮助我,请不要立即加载所有图像,而是一张一张地加载图像。
这是滑块代码:
<div style="position: relative; left: 50%; width: 5000px; text-align: center; margin-left: -2500px;">
<!-- Jssor Slider Begin -->
<div id="slider1_container" >
<!-- Loading Screen -->
<div u="loading" style="position: absolute; top: 0px; left: 0px;">
<div style="filter: alpha(opacity=70); opacity: 0.7; position: absolute; display: block;
top: 0px; left: 0px; width: 100%; height: 100%;">
</div>
<div style="position: absolute; display: block; background: url(images/AjaxLoader.gif) no-repeat center center;
top: 0px; left: 0px; width: 100%; height: 100%;">
</div>
</div>
<!-- Slides Container -->
<div u="slides" style="position: absolute; left: 0px; top: 0px; width: 900px;
height: 477px; overflow: hidden;">
<!-- here all the slides div appears -->
</div>
</div>
</div>
在脚本中添加了这个
var _SlideshowTransitions = [
//Fade
{$Duration: 900, $Opacity: 2, $Brother: { $Duration: 1200, $Opacity: 2} }
];
var options = {
$ShowLoading:true,
$AutoPlay: true,
$Fade: true, // for fade
$AutoPlayInterval: 4000,
$PauseOnHover: 1,
$ArrowKeyNavigation: true,
$SlideDuration: 500,
$MinDragOffsetToSlide: 20,
$SlideSpacing: 0,
$Cols: 1,
$Align: 0,
$UISearchMode: 1,
$PlayOrientation: 1,
$DragOrientation: 1,
$SlideshowOptions: {
$Class: $JssorSlideshowRunner$,
$Transitions: _SlideshowTransitions,
$TransitionsOrder: 1,
$ShowLink: true
},
};
【问题讨论】:
-
发布重现您的问题的示例代码,例如在jsfiddle.net