Index.html part
<! DOCTYPE html>
<meta charset= "UTF-8" >
<title> Atlas </title>
<link rel= "stylesheet" href= "Css/index.css" >
<script src= "Js/jquery.js" ></script>
<script src= "Js/superslide.js" ></script>
<body>
<ul class= "pic" >
<li> </li>
<li></li>
<li></li>
<li> </li>
<li> </li>
<li> </li>
<li> </li>
<li> </li>
<li> </li>
</ul>
<div class= "Gray" >
<a href= "javascript:;" ></a>
<a href= "javascript:;" ></a>
<a href= "javascript:;" ></a>
</div>
<script>
var imgh=$ ('. Gray. img '). Height ();
var h=imgh/2;
$ ('. img '). CSS (' margin-top ',-h+ ' px ');
$ ('. Gray '). Hide ();
var index=0;
$ ('. pic li img '). Click (function (e) {
E.stoppropagation ();
$ ('. Gray '). Show ();
var s = $ (this). attr (' src ');
$ ('. Gray. img '). attr (' src ', s);
var index=$ (this). index () +1;
})
$ ('. Gray '). Click (function () {
$ ('. Gray '). Hide ();
})
$ ('. Next '). Click (function (e) {
E.stoppropagation ();
index++;
if (index>9) {
Index=1; }
$ ('. Gray. img '). attr (' src ', ' images/big ' +index+ '. jpg ');
})
$ ('. Pre '). Click (function (e) {
E.stoppropagation ();
index--;
if (index<1) {
index=9; }
$ ('. Gray. img '). attr (' src ', ' images/big ' +index+ '. jpg ');
})
</script>
<!--<script>
JQuery (". Slidebox"). Slide ({maincell: ". BD ul", autoplay:true});
</script>
</body>
Index.css part
@charset "Utf-8";
*{MARGIN:0;PADDING:0};
html{
height:100%;
}
body{
width:100%;
}
UL li{
List-style:none;
}
. pic{
max-width:1920px;
width:80%;
margin:0 Auto;
}
. pic li{
width:33.33333%;
Display:block;
Float:left;
}
. pic img{
width:84%;
padding:2%;
margin:4%;
BOX-SHADOW:0.2VH 0.2VH 8VH RGB (152, 87, 133);
}
. gray{
position:fixed;
left:0;
top:0;/**/
width:0;
width:100%;
height:100%;
Background-color:rgba (0,0,0,0.7);
}
. img{
Position:absolute;
width:50%;
padding:1%;
Background-color: #fff;
left:25%;
top:50%;
}
. pre{
Position:absolute;
width:3%;
left:20%;
padding:1%;
Background-color: #fff;
top:50%;
Box-sizing:border-box;
}
. next{
Position:absolute;
width:3%;
left:80%;
padding:1%;
Background-color: #fff;
top:50%;
Box-sizing:border-box;
}
20160614 HTML5 Learning Code (ATLAS)