所属分类:网页特效-焦点图/幻灯片
<script src="js/jquery.min.js" type="text/javascript"></script>
如果你引入其高版本的jquery,可能出现方法无效,此时请加入jQuery版本迁移辅助插件
<script src="http://www.sucainiu.com/themes/cdn/js/jquery-migrate-1.2.1.min.js"></script>
核心JS文件
<script src="js/slideshow-jq.js" type="text/javascript"></script>
(function($){
function init(){
wSlideshow.render({
elementID:"mysite",//Dom 渲染的容器
nav:"double_thumbnails",//看你是否需要有导航功能如果参数配置参数:[none,double_thumbnails] 则会显示图片导航条
navLocation:"left", //自定标题的位置参数:[top,bottomm,left,right]
captionLocation:"bottom",//自定标题的位置参数:[top,bottom]
transition:"fade",//自定效果参数:[top,bottom]slide fade]
autoplay:"1",//自定义auto play 的次数
speed:"5",
aspectRatio:"auto",
showControls:"true",
randomStart:"false",
images:[
{"url":"images/5568730.jpg","width":"332","height":"250","caption":"Foreign staff, Chinese Imperial Maritime Customs, Tientsin, 1877 or 1878 Photographed by William Francis Stevenson Collected by Peter Hodge"},
{"url":"images/1676626.jpg","width":"332","height":"250","caption":"The Bund, Shanghai, 1890s Photographed by William Francis Stevenson Collected by Peter Hodge"},
{"url":"images/6765636.jpg","width":"332","height":"250","caption":"Chinese farmers collected by http://www.sucainiu.com"},
{"url":"images/4735676.jpg","width":"332","height":"250","caption":"Chinese coolie collected by http://www.sucainiu.com"},
{"url":"images/474001.jpg","width":"332","height":"250","caption":"The Bund, Shanghai, 1890s Photographed by William Francis Stevenson Collected by Peter Hodge"},
{"url":"images/5145203.jpg","width":"332","height":"250","caption":"Chinese empress in Qing Dynasty collected by http://www.sucainiu.com"},
{"url":"images/1363237.jpg","width":"332","height":"250","caption":"Nanking Road, Shanghai, looking towards the Bund, 1890s Photographed by William Francis Stevenson Collected by Peter Hodge"},
{"url":"images/652076.jpg","width":"332","height":"250","caption":"Chinese emperor in Qing Dynasty collected by http://www.sucainiu.com"},
{"url":"images/7168681.jpg","width":"332","height":"250","caption":"Chinese women raising cocoons collected by http://www.sucainiu.com"}
]//定义图片url caption widh height
})
}
$ ? $(init) : document.observe('dom:loaded', init)
})(window._W && _W.$)
<div class="mySlideWrap">
<div id='mysite-slideshow'></div>
</div>