Move the mouse over the list to display images and detailed information

Source: Internet
Author: User

<% @ Page Language = "C #" autoeventwireup = "true" codebehind = "webform1.aspx. cs" inherits = "cnnorco2010.webform1" %>

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html;"/>
<Title> prompt box effect </title>
<Style type = "text/CSS">
Ul, P {margin: 0; padding: 0 ;}

. Topcn {width: 300px; line-Height: 27px; font-size: 12px ;}

. Topcn A {font-size: 12px ;}

. Topcn Li {border-bottom: #000 1px dotted; display: inline-block; clear: Both ;}

. Topcn span {float: Left; width: 17px; Height: 15px; line-Height: 15px; text-align: center; font-size: 9px; font-family: verdana, geneva, sans-serif; margin: 5px 5px 0 0; Background-color: # 99c ;}

. Topcn P,. topcn Div {float: Left; width: 278px ;}

. Topcn P code {float: Right; color: #9f9fa1 ;}

. Topcn IMG {width: 67px; Height: 50px; Border: #000 1px solid; float: Left; margin: 3px 10px 0 0 0; display: inline; Background-color: # CCF ;}

. Topcn em {display: block; color: # 919b9d ;}

. Topcn Div {Line-Height: 19px; padding-bottom: 5px; display: none ;}

</Style>

<SCRIPT type = "text/JavaScript">

Function ranklist (ID, ELE, elename, elechild, start_ele, cur_ele ){

VaR obj_id = Document. getelementbyid (ID );

VaR obj_ele = $ tag (obj_id, ELE );

For (I = 0; I <obj_ele.length; I ++ ){

If (obj_ele [I]. classname. indexof (elename) =-1) continue;

VaR objlist = $ tag (obj_ele [I], elechild );

For (j = 0; j <objlist. length; j ++ ){

Objlist [J]. onmouseover = function (){

VaR Paris = This. parentnode;

VaR list = $ tag (Paris, elechild );

For (x = 0; x <list. length; X ++ ){

VaR thisdiv = $ tag (list [X], cur_ele) [0];

VaR thisp = $ tag (list [X], start_ele) [0];

Thisdiv. style. Display = "NONE ";

Thisp. style. Display = "Block ";

}

VaR start = $ tag (this, start_ele) [0];

Start. style. Display = 'none ';

VaR cur = $ tag (this, cur_ele) [0];

Cur. style. Display = 'block ';

}

}

}

}

Function $ tag (ID, tag) {return ID. getelementsbytagname (TAG );}

SetTimeout ("ranklist ('ranklist', 'U', 'toppcn', 'lil', 'P', 'div ')", 0 );

/* Parameter explanation:

Ranklist: to narrow down the search object range of a function in the document, an ID parameter is set for the function;

Ul: traverses the UL element list within the search range. This is the ele parameter. to exclude ul elements unrelated to the effect, the class topcn is added to it, which is the elename parameter;

Traverse the Li list element in the specified ul. When the Li element is clicked, corresponding events are generated;

P: indicates a text list line;

Div: displays the detailed information area;

*/

</SCRIPT>
</Head>
<Body>
<Div id = "ranklist">

<Ul class = "topcn">

<Li>

<Span> 1 </span>

<P style = "display: none;"> <code> 2007-2-10 </code> <a href = "#"> move the mouse over the list text display </a> </P>

<Div style = "display: block;">

<A href = "#"> </a>

<A href = "#"> move the cursor over the list to display the image and detailed information. </a>

<Em> daily increase: 666 </em>

</Div>

</LI>

<Li>

<Span> 2 </span>

<P> <code> 2007-2-10 </code> <a href = "#"> move the mouse over the list text display </a> </P>

<Div>

<A href = "#"> </a>

<A href = "#"> move the cursor over the list to display the image and detailed information. </a>

<Em> daily increase: 666 </em>

</Div>

</LI>

<Li>

<Span> 3 </span>

<P> <code> 2007-2-10 </code> <a href = "#"> move the mouse over the list text display </a> </P>

<Div>

<A href = "#"> </a>

<A href = "#"> move the cursor over the list to display the image and detailed information. </a>

<Em> daily increase: 666 </em>

</Div>

</LI>

</Ul>

</Div>

 

 

</Body>
</Html>

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.