Javascript pull-down effect

Source: Internet
Author: User
Tip: you can modify some code before running

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><ptml xmlns="http://www.w3.org/1999/xhtml"><pead><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title></title><style type="text/css">* {Margin: 0px; padding: 0px; border: 0px;} body {font-size: 12px; color: #333; text-align: center ;}. test5study {background: # fff ;}. test5study {text-align: left; width: 220px; height: auto; border: solid 1px # F7BE21; margin: 10px auto 0px; overflow: hidden; position: absolute; left: 10px; top: 0px ;}. test5study h2 {font-size: 14px; height: 22px; line-height: 22px; background: # FFF7C6; text-indent: 10px; position: relative; border-top: 1px solid # fff; border-bottom: 1px solid # F7BE21; font-weight: normal; cursor: pointer ;}. test5study h2 span {font-weight: normal; position: absolute; top: 0; right: 6px ;}. test5study li {border-bottom: dashed 1px # eee ;}. test5study {border-bottom: solid 1px # F7BE21 ;}. txtList {list-style: disc url (none); margin: 6px 10px 6px 20px ;}</style></pead><body><div id="Test5study" class="Test5study"><p id="t1" onclick="ShHi('t1','h1');">More legends...</p><ul class="TxtList" id="h1" ><li>Please help optimize this code...</li><li>Please help optimize this code...</li><li>Please help optimize this code...</li><li>Please help optimize this code...</li></ul><p id="t2" onclick="ShHi('t2','h2');">More legends...</p><ul class="TxtList" id="h2" ><li>Please help optimize this code...</li><li>Please help optimize this code...</li><li>Please help optimize this code...</li><li>Please help optimize this code...</li></ul><p id="t3" onclick="ShHi('t3','h3');">More legends...</p><ul class="TxtList" id="h3" ><li>Please help optimize this code...</li><li>Please help optimize this code...</li><li>Please help optimize this code...</li><li>Please help optimize this code...</li></ul><p id="t4" onclick="ShHi('t4','h4');">More legends...</p><ul class="TxtList" id="h4" ><li>Please help optimize this code...</li><li>Please help optimize this code...</li><li>Please help optimize this code...</li><li>Please help optimize this code...</li></ul></div><script type="text/javascript">/* Homepage: www.111cn.net */function $ (d) {return document. getElementById (d);} function f (d) {var t = $ (d); if (t) {return t. style;} else {return null;} function Hi () {var items = document. getElementsByTagName ("ul"); for (var I = 0; I<items.length;i++){items[i].style.display='none';}}function Hl(){var iteml = document.getElementsByTagName("h2");for (var j=0;j<iteml.length;j++){iteml[j].style.fontWeight='normal';}}function h(d){var s=f(d);var b=s.display;if (b=='none'){return true;}else{return false;}}function ShHi(ii,jj){if(h(jj)){f(jj).display='block';f(ii).fontWeight='bold';}else{f(jj).display='none';f(ii).fontWeight='normal';}}</script></body></ptml>
Tip: you can modify some code before running
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.