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

Implementation code of jquery tabs_jquery

WBOY
WBOYOriginal
2016-05-16 18:52:161212browse

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"):

Statement:
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