Production of jquery tab page_jquery
May 16, 2016 pm 06:27 PMOne thing you need to pay special attention to here is to set a delay for the mouseover event of the label, so as to prevent the user from maliciously moving the mouse, causing a large number of requests and causing the server to crash. The setTimeout function is used, mainly for the downloaded events
1 $().each(function(){}) This is a very important way to traverse all tags
2 mouseover event,
and the key css style Write and control the displayed style,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>tab </TITLE>
< link rel="stylesheet" type="text/css" href="css/tab.css">
<script type="text/javascript" src="js/jquery-1.4.2.js" ></script>
<script type="text/javascript" src="js/tab.js"></script>
</HEAD>
<BODY>
<ul id="ularea">
<li class="listli">Tag1</li>
<li >Tag2</li> < ;/div> 🎜>
Copy code
The code is as follows:
ul ,li { margin:0px;
padding: 0px;
}
.listli { background-color: #663333;
border:1px solid #663333;
}
div { clear:left;
width:300px;
height:100px;
background-color: #663333;
border-top:0px;
color:white;
display:none;
}
.divarea { display:block; }
The next step is to write js to control sliding
Copy the code
The code is as follows:
// Define global variables
var timeout;
// $( "div").eq(index).addClass("divarea"); //Another way to write it is:$(div:eq(index)).addClass("divarea");
$("div: eq(" index ")").addClass("divarea");
$("li").eq(index).addClass("listli");
},
320);
$(this).mouseout(function(){
clearTimeout(timeout);
});
});
});
});

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

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

Detailed explanation of jQuery reference methods: Quick start guide

How to use PUT request method in jQuery?

How to remove the height attribute of an element with jQuery?

jQuery Tips: Quickly modify the text of all a tags on the page

Use jQuery to modify the text content of all a tags

Understand the role and application scenarios of eq in jQuery

How to tell if a jQuery element has a specific attribute?

Summary of commonly used file operation functions in PHP
