photoSlider-原生js移動開發輪播圖、相簿滑動外掛程式

來源:互聯網
上載者:User

標籤:

 

詳細內容請點擊

 

線上預覽   立即下載

使用方法:

分別引用css檔案和js檔案 如:


<link rel="stylesheet" type="text/css" href="css/photoSlider.min.css" />
<script src="js/photoSlider.min.js" type="text/javascript" charset="utf-8"></script>

html:


<li><a href="http://www.j--d.com"><img src="img/1.jpg" /></a></li>
<li><a href="http://www.j--d.com"><img src="img/2.jpg" /></a></li>
<li><a href="http://www.j--d.com"><img src="img/3.jpg" /></a></li>

javascript:


window.onload=function(){
photoSlide({
wrap: document.getElementById(‘photo‘),//最外層容器
loop: true,//設定無縫迴圈
autoPlay:true,//自動輪播
autoTime:4000,//輪播時間間隔
pagination:true //點狀態列表
});
}

完整樣本:

 

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>photoSlider-純js移動開發輪播圖、相簿滑動外掛程式</title>
<meta name="keywords" content="javascript移動端相簿輪播圖手指滑動外掛程式" />
<meta name="description" content="javascript移動端相簿輪播圖手指滑動外掛程式,支援自訂輪播圖滑動屬性" />
<meta name=apple-mobile-web-app-title content="photoSlider">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name=renderer content=webkit>
<meta name="full-screen" content="yes">
<meta name="browsermode" content="application">
<meta name="x5-fullscreen" content="true">
<meta name="x5-page-mode" content="app">
<link rel="stylesheet" type="text/css" href="css/photoSlider.min.css" />
</head>
<body>
<div id="photo">
<div id="loading" class="spinner">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
</div>
<ul id="pic-view" class="pic-view">
<li><a href="http://www.j--d.com"><img src="img/1.jpg" /></a></li>
<li><a href="http://www.j--d.com"><img src="img/2.jpg" /></a></li>
<li><a href="http://www.j--d.com"><img src="img/3.jpg" /></a></li>
</ul>
</div>
</body>

</html>

<script src="js/photoSlider.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
document.onreadystatechange = subSomething;
function subSomething() {
if (document.readyState == ‘complete‘) {
setTimeout(function(){
var load=document.getElementById(‘loading‘);
load.style.opacity=0;
document.getElementById(‘pic-view‘).setAttribute(‘class‘,‘pic-view show‘);
load.remove();
},500);
}
}
window.onload=function(){
photoSlide({
wrap: document.getElementById(‘photo‘),
loop: true,
autoPlay:true,
autoTime:4000,
pagination:true
});
}
</script>

 

手機預覽效果請掃描二維碼:

線上預覽   立即下載

 

 

學習來源:http://www.j--d.com/html/349.html

 

更多特效內容請點擊

 

photoSlider-原生js移動開發輪播圖、相簿滑動外掛程式

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.