Simple Click to toggle graph

Source: Internet
Author: User

<! 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.