简体   繁体   English

jQuery周期图像滑块插件(图像加载时间)

[英]jquery cycle image slider plugin(image load time)

If you check out the site stretchshapes.net, you can see we are using a plugin call VTEM slider to show advertisements on the top of our site. 如果您查看网站网址网址网址网址网址shapeshapes.net,可以看到我们正在使用一个名为VTEM插件的插件在我们网站的顶部显示广告。

It had been working fine for a number of months but just recently the image loading time have started taking forever. 它已经工作了好几个月,但最近才开始永久加载图像。 for example when the page loads you can see 3 or four of the slides that show appear later appearing below where the slider is located, then disappearing behind the slider, to be reveal later. 例如,当页面加载时,您可以看到显示的3或4张幻灯片稍后出现在滑块所在的位置下方,然后消失在滑块后面,以供稍后显示。

I have tried optimizing loading time of images but it didn't seem to do much. 我曾尝试优化图像的加载时间,但似乎并没有做很多事情。 Seems to me that the jquery i am using to launch this should be able hid all the image behind one another in the first place not after the images load. 在我看来,我用来启动此功能的jquery应该首先能够将所有图像隐藏在一起,而不是在图像加载之后。 Make sense? 说得通? i hope so.. 希望如此..

Here is the jquery that launches the slider: 这是启动滑块的jQuery:

 <script type="text/javascript">
 /* <![CDATA[ */
 $(document).ready(function(){$('#vtemslideshow1').cycle({fx:'scrollHorz',timeout:6500,speed:1000,next:'#cycle_next',prev:'#cycle_prev',pager:'#vtemnav',pagerEvent:'click',pagerAnchorBuilder:pagerFactory,startingSlide:0,fit:true,height:69,width:425});function pagerFactory(idx,slide){return'#vtemnav a:eq('+idx+') span';};});/* ]]> */
 </script>

I'm not sure this is your issue but before calling your slide show you can hide all the slides and then they shouldn't appear. 我不确定这是否是您的问题,但是在调用幻灯片放映之前,您可以隐藏所有幻灯片,然后再不显示它们。 Consequently you could just add display:none on the server side to all but the first to be sure they are never displayed outside the slider. 因此,您可以只在服务器端添加display:none ,除了第一个,以确保它们不会在滑块之外显示。

$('#vtemslideshow1 a:gt(0)').hide(); // hide all but first $('#vtemslideshow1 a:gt(0)').hide(); // hide all but first $('#vtemslideshow1').cycle({fx:'scrollHorz',timeout:6500,speed:1000,next:'#cycle_next',prev:'#cycle_prev',pager:'#vtemnav',pagerEvent:'click',pagerAnchorBuilder:pagerFactory,startingSlide:0,fit:true,height:69,width:425}); $('#vtemslideshow1 a:gt(0)').hide(); // hide all but first $('#vtemslideshow1').cycle({fx:'scrollHorz',timeout:6500,speed:1000,next:'#cycle_next',prev:'#cycle_prev',pager:'#vtemnav',pagerEvent:'click',pagerAnchorBuilder:pagerFactory,startingSlide:0,fit:true,height:69,width:425});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM