Home > Web Front-end > JS Tutorial > Implementation code of jquery tabs_jquery

Implementation code of jquery tabs_jquery

WBOY
Release: 2016-05-16 18:52:16
Original
1219 people have browsed it

Key code:

Copy code The code is as follows:

$(function(){
$(".tabs li").eq(0).css("background","#499AFF");
$(".tabs div").eq(0).show();
$(".tabs>ul>li").click(function(i){
$(this).css("background","#499AFF").siblings().css("background"," #ffffff");
$(".tabs div").eq($("li").index(this)).show().siblings("div").hide();
return false;
})
})

Demo (please refresh once after "Run Code"):

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template