CSS +javascript mimic Select effect code

Source: Internet
Author: User

<style type= "Text/css" >

#mainbox {
width:84px;
Background-image:url (e_pic/select.jpg);
Background-repeat:no-repeat;
font-size:12px;
}
#box0 {
width:63px;
height:28px;
Float:left;
padding-top:7px;
padding-left:7px;
}
#box1 {
width:10px;
height:28px;
Cursor:pointer;
Float:left;
Text-align:center;
padding-top:2px;
}
#items {
BORDER:1PX solid black;
width:78px;
Display:none;
}
#box3 {
width:83px;
/*border-bottom:1px solid Green;
border-left:1px solid Green;
border-right:1px solid Green;
*/
padding-left:4px;
}
. over{
Background-color: #11586E;
Font-weight:bold;
Color: #FFF;
/*border-top:1px dotted black;
border-bottom:1px dotted black;*/
Cursor:pointer;
}
</style>
<script type= "Text/javascript" defer>
var Odiv0=document.getelementbyid ("box0");
var Odiv1=document.getelementbyid ("Box1");
var Odiv=document.getelementbyid ("items");
Odiv1.onclick=function () {
odiv.style.display=odiv.style.display== "Block"? None ": Block";
Show ();
}
function Hide (obj) {
var obj=obj;
Obj.parentnode.style.display= "None";
}
Function Show () {
for (Var i=0;i<odiv.childnodes.length;i++) {
Odiv.childnodes[i].onmouseover=function () {
This.classname= "Over";
}
Odiv.childnodes[i].onmouseout=function () {
This.classname= "";
}
Odiv.childnodes[i].onclick=function () {
odiv0.innerhtml=this.innerhtml;
Hide (this);
if (ODiv0.innerText.indexOf ("Vincent")!=-1) {
window.open ("Http://www.111cn.net/vincent", "", "");
}
}
}
}
</script>
<body>
<div id= "Mainbox" >
<div id= "box0" ></div>
<div id= "Box1" ></div>
<div id= "Items" >
<div id= "Box3" > Hubei </div>
<div id= "box3" > Web page </div>
<div id= "Box3" > Xiaogan </div>
<div id= "Box3" > Zhijiang </div>
<div id= "Box3" > Hanchuan </div>
<div id= "Box3" > </div>
<div id= "Box3" >asp tutorials </div>

</div>
</div>
<!---->
</body>

Related Article

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.