web前端|js教程
jQuery,tab标签,自动,切换,方法
web前端-js教程
本文实例讲述了jQuery实现tab标签自动切换的方法。分享给大家供大家参考。具体实现方法如下:
xmpp源码,ubuntu修改终端名,爬虫代理 固定ip,PHP开战,seo教材入门lzw
页面弹框js源码,vscode网页显示色块,Ubuntu网卡路由,web里的tomcat,团队爬虫游戏,php树形遍历,肇庆seo优化联系方式,asp网站源码防止下载,wordpress大前端模板lzw
* {
margin:0;
padding:0;
}
dl {
margin:10px auto;
width:500px;
line-height:24px;
border-left:1px solid #dcdcdc;
}
dt.active {
border-bottom:1px solid #fff;
position:relative;
}
dt {
padding:0 10px;
float:left;
border:1px solid #dcdcdc;
border-left:0;
cursor:pointer;
margin-bottom:-1px;
}
dd {
clear:both;
width:100%;
border-left:0;
border:1px solid #dcdcdc;
border-left:0;
display:none;
}
android splash 源码,vscode dubug,ubuntu cc,tomcat的运行不依赖jvm,sqlite 并发写入,手机版网页设计案例,阿里云服务器代理续费,js表格排序插件,移动前端框架重置,代爬虫多少钱,php对称加密算法,密码seo,仿网站源码是怎么弄的,相册视频制作网页程序源码,百变模板图谱,thinkphp 抓取微信页面,美萍会员管理系统注册码,vb调用excel程序lzw
nav1
nav2
nav3
1111111111111111111111
2222222222222222222222
3333333333333333333333
$(document).ready(function(){
$(dt:first).addClass(active);
$(dd:first).css(display,lock);
autoroll();
hookThumb();
});
var i=-1; //第i+1个tab开始
var offset = 2500; //轮换时间
var timer = null;
function autoroll(){
n = $(dt).length-1;
i++;
if(i > n){
i = 0;
}
slide(i);
timer = window.setTimeout(autoroll, offset);
}
function slide(i){
$(dt).eq(i).addClass(active).siblings().removeClass(active);
$(dd).eq(i).css(display,lock).siblings(dd).css(display, one);
}
function hookThumb(){
$(dt).hover(
function () {
if (timer) {
clearTimeout(timer);
i = $(this).prevAll().length;
slide(i);
}
},
function () {
timer = window.setTimeout(autoroll, offset);
this.blur();
return false;
}
);
}