Javascript simple tab special effect code

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"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Simple Tab</title><style>body,ul,li{margin:0;padding:0;}body{font:12px/1.5 Tahoma;}#outer{width:450px;margin:10px auto;}#tab{overflow:hidden;zoom:1;background:#000;border:1px solid #000;}#tab li{float:left;color:#fff;height:30px;cursor:pointer;line-height:30px;list-style-type:none;padding:0 20px;}#tab li.current{color:#000;background:#ccc;}#content{border:1px solid #000;border-top-width:0;}#content ul{line-height:25px;display:none;margin:0 30px;padding:10px 0;}</style><script>window.onload = function (){var oLi = document.getElementById("tab").getElementsByTagName("li");var oUl = document.getElementById("content").getElementsByTagName("ul");for(var i = 0; i < oLi.length; i++){oLi[i].index = i;oLi[i].onmouseover = function (){for(var n = 0; n < oLi.length; n++) oLi[n].className="";this.className = "current";for(var n = 0; n < oUl.length; n++) oUl[n].style.display = "none";oUl[this.index].style.display = "block"}}}</script></head><body><div id="outer"> <ul id="tab"> <li class="current">Lesson 1</li> <li>Lesson 2</li> <li>Lesson 3</li> </ul> <div id="content"> <ul > <li>Analysis of webpage special effects</li> <li>Respond to user operations</li> <li>Prompt Box effect</li> <li>Event-driven</li> <li>Element attribute operations</li> <li>Write the first JS special effect</li> <li>Introduce functions</li> <li>Webpage skin change effect</li> <li>Expand/contract the playback list</li> </ul> <ul> <li>Change webpage background color</li> <li>Function parameters</li> <li>Compilation of highly reusable functions</li> <li>126 select all emails</li> <li>Loop and traversal operations</li> <li>Simple use of the debugger</li> <li>Composition of typical loops</li> <li>For loop and if judgment</li> <li>Use of className</li> <li>Use of innerHTML</li> <li>Cannes impressions</li> <li>Array</li> <li>String connection</li> </ul> <ul> <li>JavaScript composition: ECMAScript, DOM, BOM, JavaScript compatibility source</li> <li>Location, advantages and disadvantages of JavaScript</li> <li>Variable, type, typeof, data type conversion, variable scope</li> <li>Closure: What are the disadvantages of closure, simple application, and closure?</li> <li>Operators: arithmetic, value assignment, relation, logic, and other operators</li> <li>Program process control: Judgment, loop, jump out</li> <li>Naming rules: naming rules and necessity, Hungarian naming law</li> <li>Function description: function composition, calling, events, passing parameters, variable parameters, and return values</li> <li>Timer usage: setInterval and setTimeout</li> <li>Timer application: webmaster station navigation effect</li> <li>Timer application: Automatic Playback tab</li> <li>Timer application: digital clock</</td> </tr></table>
Tip: you can modify some code before running

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.