<! DOCTYPE html>
<meta charset= "Utf-8" >
<title> Practice </title>
<style type= "Text/css" >
*{
margin:0;
padding:0;
margin:0 Auto;
}
. cas{
margin-top:100px;
width:400px;
height:430px;
Background-color:skyblue;
}
#cssa {
width:160px;
height:360px;
/*margin-top: -100px;*/
Background:url (images/2.jpg) top center;
}
. shubai{
Cursor:pointer;
/*margin-top:100px;*/
}
/*.shubai ul{
Float:left;
List-style:none;
}*/
. Shubai ul. casa1{
Float:left;
width:60px;
height:20px;
}
. Shubai ul. casa2{
Float:left;
width:60px;
height:20px;
}
. Shubai ul. casa3{
Float:left;
width:60px;
height:20px;
}
. Shubai ul. casa4{
Float:left;
width:60px;
height:20px;
}
. Shubai ul. casa5{
Float:left;
width:60px;
height:20px;
}
. Shubai li{
width:40px;
height:20px;
margin-top:390px;
List-style:none;
/*line-height:18px;*/
Background-color: #3E3E3E;
Float:left;
Text-align:center;
Color: #FFFFFF;
/*border-radius:50%;*/
/*margin:0 40px 0 60px;*/
/*cursor:pointer;*/
margin-left:16px;
}
</style>
<body>
<div class = "CAS" >
<div class = "Shubai" >
<ul class = "Kaishi" >
<li class = "CASA1" id = "PXC1" >picture1</li>
<li class = "CASA2" id = "Pxc2" >picture2</li>
<li class = "casa3" id = "Pxc3" >picture3</li>
<li class = "casa4" id = "Pxc4" >picture4</li>
<li class = "Casa5" id = "Pxc5" >picture5</li>
</ul>
</div>
<div id = "CSSA" ></div>
</div>
<script type= "Text/javascript" >
var pxc = document.getElementById ("Cssa");
var P1 = document.getElementById ("Pxc1");
var P2 = document.getElementById ("Pxc2");
var p3 = document.getElementById ("Pxc3");
var P4 = document.getElementById ("Pxc4");
var P5 = document.getElementById ("Pxc5");
Pxc1.onclick = function () {
pxc.style.backgroundImage = "url (images/1.jpg)";
}
Pxc2.onclick = function () {
pxc.style.backgroundImage = "url (images/2.jpg)";
}
Pxc3.onclick = function () {
pxc.style.backgroundImage = "url (images/3.jpg)";
}
Pxc4.onclick = function () {
pxc.style.backgroundImage = "url (images/4.jpg)";
}
Pxc5.onclick = function () {
pxc.style.backgroundImage = "url (images/5.gif)";
}
</script>
</body>
Simple Click to toggle graph