


JS realizes the black simple sliding door web tab effect_javascript skills
The example in this article describes the realization of a simple black sliding door web tab effect using js. Share it with everyone for your reference. The details are as follows:
This is a black style web sliding door menu implemented in js. Although it is simple, it still looks grand. You can change it to a tab with a slight modification. Friends who know JS can modify it well and change it to what you like. style.
The screenshot of the running effect is as follows:
The online demo address is as follows:
http://demo.jb51.net/js/2015/js-simple-black-style-web-tab-codes/
The specific code is as follows:
<!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>黑色简易的选项卡</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">第一课</li> <li>第二课</li> <li>第三课</li> </ul> <div id="content"> <ul style="display:block;"> <li>网页特效原理分析</li> <li>响应用户操作</li> <li>提示框效果</li> <li>事件驱动</li> <li>元素属性操作</li> <li>动手编写第一个JS特效</li> <li>引入函数</li> <li>网页换肤效果</li> <li>展开/收缩播放列表效果</li> </ul> <ul> <li>改变网页背景颜色</li> <li>函数传参</li> <li>高重用性函数的编写</li> <li>126邮箱全选效果</li> <li>循环及遍历操作</li> <li>调试器的简单使用</li> <li>典型循环的构成</li> <li>for循环配合if判断</li> <li>className的使用</li> <li>innerHTML的使用</li> <li>戛纳印象效果</li> <li>数组</li> <li>字符串连接</li> </ul> <ul> <li>JavaScript组成:ECMAScript、DOM、BOM,JavaScript兼容性来源</li> <li>JavaScript出现的位置、优缺点</li> <li>变量、类型、typeof、数据类型转换、变量作用域</li> <li>闭包:什么是闭包、简单应用、闭包缺点</li> <li>运算符:算术、赋值、关系、逻辑、其他运算符</li> <li>程序流程控制:判断、循环、跳出</li> <li>命名规范:命名规范及必要性、匈牙利命名法</li> <li>函数详解:函数构成、调用、事件、传参数、可变参、返回值</li> <li>定时器的使用:setInterval、setTimeout</li> <li>定时器应用:站长站导航效果</li> <li>定时器应用:自动播放的选项卡</li> <li>定时器应用:数码时钟</li> <li>程序调试方法</li> </ul> </div> </div> </body> </html>
I hope this article will be helpful to everyone’s JavaScript programming design.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to use JS and Baidu Map to implement map pan function Baidu Map is a widely used map service platform, which is often used in web development to display geographical information, positioning and other functions. This article will introduce how to use JS and Baidu Map API to implement the map pan function, and provide specific code examples. 1. Preparation Before using Baidu Map API, you first need to apply for a developer account on Baidu Map Open Platform (http://lbsyun.baidu.com/) and create an application. Creation completed

Face detection and recognition technology is already a relatively mature and widely used technology. Currently, the most widely used Internet application language is JS. Implementing face detection and recognition on the Web front-end has advantages and disadvantages compared to back-end face recognition. Advantages include reducing network interaction and real-time recognition, which greatly shortens user waiting time and improves user experience; disadvantages include: being limited by model size, the accuracy is also limited. How to use js to implement face detection on the web? In order to implement face recognition on the Web, you need to be familiar with related programming languages and technologies, such as JavaScript, HTML, CSS, WebRTC, etc. At the same time, you also need to master relevant computer vision and artificial intelligence technologies. It is worth noting that due to the design of the Web side

How to use PHP and JS to create a stock candle chart. A stock candle chart is a common technical analysis graphic in the stock market. It helps investors understand stocks more intuitively by drawing data such as the opening price, closing price, highest price and lowest price of the stock. price fluctuations. This article will teach you how to create stock candle charts using PHP and JS, with specific code examples. 1. Preparation Before starting, we need to prepare the following environment: 1. A server running PHP 2. A browser that supports HTML5 and Canvas 3

Essential tools for stock analysis: Learn the steps to draw candle charts in PHP and JS. Specific code examples are required. With the rapid development of the Internet and technology, stock trading has become one of the important ways for many investors. Stock analysis is an important part of investor decision-making, and candle charts are widely used in technical analysis. Learning how to draw candle charts using PHP and JS will provide investors with more intuitive information to help them make better decisions. A candlestick chart is a technical chart that displays stock prices in the form of candlesticks. It shows the stock price

Overview of how to use JS and Baidu Maps to implement map click event processing: In web development, it is often necessary to use map functions to display geographical location and geographical information. Click event processing on the map is a commonly used and important part of the map function. This article will introduce how to use JS and Baidu Map API to implement the click event processing function of the map, and give specific code examples. Steps: Import the API file of Baidu Map. First, import the file of Baidu Map API in the HTML file. This can be achieved through the following code:

How to use JS and Baidu Maps to implement the map heat map function Introduction: With the rapid development of the Internet and mobile devices, maps have become a common application scenario. As a visual display method, heat maps can help us understand the distribution of data more intuitively. This article will introduce how to use JS and Baidu Map API to implement the map heat map function, and provide specific code examples. Preparation work: Before starting, you need to prepare the following items: a Baidu developer account, create an application, and obtain the corresponding AP

With the rapid development of Internet finance, stock investment has become the choice of more and more people. In stock trading, candle charts are a commonly used technical analysis method. It can show the changing trend of stock prices and help investors make more accurate decisions. This article will introduce the development skills of PHP and JS, lead readers to understand how to draw stock candle charts, and provide specific code examples. 1. Understanding Stock Candle Charts Before introducing how to draw stock candle charts, we first need to understand what a candle chart is. Candlestick charts were developed by the Japanese

The relationship between js and vue: 1. JS as the cornerstone of Web development; 2. The rise of Vue.js as a front-end framework; 3. The complementary relationship between JS and Vue; 4. The practical application of JS and Vue.
