1. 程式人生 > >圖片輪播顯示

圖片輪播顯示

製作輪播廣告: js程式碼:

var num = 0; var time = null; (function() { //jQuery標準用法(".adver").mouseover(function() { //滑鼠移入圖片,顯示左右按鈕 (".arrowLeft,.arrowRight").show();        });        //滑鼠移出圖片,隱藏左右按鍵
(".adver").mouseout(function() { $(".arrowLeft,.arrowRight").hide(); }); }); //定義陣列儲存圖片 function getImage(num) { var imgArr = new Array(); for (var i = 0; i

nav {

width: 100px;
margin: 0 auto;

}

nav li {

height: 36px;

}

nav li span {

display: block;
float: right;
width: 35px;
height: 35px;
border-bottom-left-radius: 5px;
border-top-left-radius: 5px;
background: #7a6e6e url("../images/toolbars.png") no-repeat;

}

nav li:nth-of-type(1) span {

background-position: 0px -15px;

}

nav li:nth-of-type(2) span {

background-position: 0px -57px;

}

nav li:nth-of-type(3) span {

background-position: 1px -106px;

}

nav li:nth-of-type(4) span {

background-position: 0px -156px;

}

nav li:nth-of-type(5) span {

background-position: 0px -200px;

}

nav li:nth-of-type(6) span {

background-position: 2px -265px;

}

nav li p {

height: 35px;
text-align: left;
background: #c81623;
color: #ffffff;
border-bottom-left-radius: 5px;
border-top-left-radius: 5px;
line-height: 35px;
padding-left: 10px;
display: none;

}