200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > javascript 定时自动切换的选项卡Tab_导航菜单

javascript 定时自动切换的选项卡Tab_导航菜单

时间:2021-04-08 03:39:23

相关推荐

javascript 定时自动切换的选项卡Tab_导航菜单

web前端|js教程

自动切换,选项卡,Tab

web前端-js教程

这里要注意,用于产生changeTabInterval的随机数,防止页面上TabPane过多,如果设置的changeTabInterval都一样的话会产生整齐划一的切换的效果,不美观.

微信房卡棋牌游戏源码,vscode 开发ui,Ubuntu如何查看RAM,tomcat服务日志,sqlite手册下载,jmail插件,前端框架 后端如何连接,python 爬虫性能,PHP命名空间的,seo李俊超,计算机源代码网站,安卓 网页嗅探 源码,模板html静态页面源码,留言板页面 css,国外广告管理系统,魅思CMS视频网站程序V6.0lzw

自动切换Tab选项卡function randint(m,n)//产生m-n之间的随机整数 {return Math.random()*(n-m)+m; } function IfNull(a,dv) {return typeof(a) ==”undefined”?dv:a; }

照片展示网站源码,ubuntu如何删除干净,电脑装2个tomcat,爬虫网论坛,php输出代码,荆门工程机械seo推广哪里好lzw

var TabPaneConfig = { idPrefix: “tab-panel-object-“, idCounter: 0, getId: function(){ return this.idPrefix+this.idCounter++;}, tabHeadId: “tabHead”, tabHeadClass: “tab-head tab-border”, tabBodyId: “tabBody”, tabBodyClass: “tab-border” }

易语言 读取机器码源码,vscode web程序设计,ubuntu卸载linux,tomcat接受不到请求,爬虫宠物水族,php 读取rss,对网页的seo没有帮助,开发公司网站源码,帝国cms论文模板下载地址lzw

function TabPane(id,changeTabInterval,isAutoChangeTab){ this.id = id; this.height = “100%”; this.width = “100%”;

this.tabPages = 0; this.head = null; this.body = null;

this.changeTabInterval=IfNull(changeTabInterval,10); this.isAutoChangeTab=IfNull(isAutoChangeTab,true); this.changeTabTimerId = null; }

TabPane.prototype.init = function(){ var r = document.getElementById(this.id); if(!r.style.overflow) r.style.overflow = “auto”; r.className = “tab”;

//create head var div = document.createElement(“div”); div.id = TabPaneConfig.tabHeadId; div.className = TabPaneConfig.tabHeadClass;

r.appendChild(div); this.head = div;

var ul = document.createElement(“ul”); div.appendChild(ul);

//create body div = document.createElement(“div”); div.id = TabPaneConfig.tabBodyId; div.className = TabPaneConfig.tabBodyClass;

r.appendChild(div); this.body = div;

if(this.isAutoChangeTab) {var tabPane = this;this.changeTabTimerId = setInterval(function(){onChangeTabTimer(tabPane);},this.changeTabInterval*1000); } }

TabPane.prototype.stopChangeTabTimer = function () {if(this.isAutoChangeTab) { clearInterval(this.changeTabTimerId); } }

TabPane.prototype.addTabPage = function(obj) { if(!document.getElementById(obj.panel)) return; if(!this.tabPages) this.init();

this.head.firstChild.appendChild(this.createTabTitle(obj)); this.body.appendChild(document.getElementById(obj.panel)); this.tabPages++; }

TabPane.prototype.createTabTitle = function(obj){ var li = document.createElement(“li”); li.id = TabPaneConfig.getId(); li.data = obj.panel; var tabPane = this; li.onclick=function(){tabOnClick(tabPane,li)}; li.style.width = obj.width;

if(this.tabPages) { li.className=””; document.getElementById(obj.panel).style.display=”none”; } else { li.className=”hover”; document.getElementById(obj.panel).style.display=”block”; }

var textNode = document.createTextNode(obj.title); li.appendChild(textNode); return li; }

//得到所有Tab页的Li元素 TabPane.prototype.getLiArr = function() {return this.head.firstChild.children; }

TabPane.prototype.getAcitveLi = function() {var liArr = this.getLiArr(); for(var i=0; i

.tab { font-family: Verdana, Helvetica, Arial; font-size: 12px; position: relative; width: 100%; } .tab-border {border:1px solid;border-color: rgb(120,172,255);} .tab-head { background-color:rgb(234,242,255);; border:0px; height:23px; line-height:20px; position:relative; } .tab-head ul{ border:0px; height:23px; list-style:none; margin:0px; text-align:center; padding:0; position:absolute;

} .tab-head li{ border: 1px solid; border-color: rgb(120,172,255); border-left: 0; border-bottom: 0; border-top: 0; cursor:pointer; color:#416AA3; float:left; display:block; height:22px;!important;height:20px; line-height:20px; padding: 2px 6px 0px 6px; margin-top: 2px; margin-right: -1px; text-overflow:ellipsis; white-space:nowrap; overflow:hidden;

} .tab-head li.hover{ border: 1px solid rgb(120,172,255); border-bottom: 0; padding: 0px 6px 3px 6px; margin: 0px 1px 0px 0px; background: white; font-size: 13px; font-weight: bold; color: rgb(0,66,174); overflow:visible; }

黑客零起点教学 CHM

可以加密及解密的VB屏幕键盘组件

什么样的项目经历会让面试官眼前一亮

超级j2me飞行游戏疯狂雷电源代码

可以加密及解密的VB屏幕键盘组件

编程学习中的一些错误认识

Delphi多文档几何图形绘制及编辑程序

学ACM算法题有用吗?

黑客零起点教学 CHM

超级j2me飞行游戏疯狂雷电源代码

B实现主窗体控制副窗口的显示与隐藏

Delphi多文档几何图形绘制及编辑程序

var tp = new TabPane(“divForumBoard”,randint(3,10)); tp.addTabPage({title:”公告” ,width:50 ,panel:”divForumCast”}); tp.addTabPage({title:”面板” ,width:50 ,panel:”divForumPanel”});

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。