滑动门:我不理解为什么这样叫。
我就命名为:JMenuTab吧,因为写它是为了当我的菜单。
IE6,FireFox下测试通过。
复制代码 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="JTabRes1/JMenuTab.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
margin: 0px;
}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="200"> </td>
<td id="menuBar"></td>
</tr>
</table>
<div id="page1">大大小小多多少少<br />
人口手足</div>
<div id="page2">ABCDEFG</div>
<div id="page3"><img src="/UploadFiles/2021-04-02/loading.gif"><div id="pageHelp"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>JMenuTab 帮助:</td>
</tr>
<tr>
<td>Author:xling Blog:http://xling.blueidea.com 2007/05/23 </td>
</tr>
<tr>
<td>写这个程序只是为了解决燃眉之急(汉,虽然是急,我还是写了一天)!</td>
</tr>
<tr>
<td>程序中用到图片是修改了网上现有图片,所以,外表和某些网站上的一样,请不要见怪。因为除了图片,全是原创(不曾参考任何类似程序)!</td>
</tr>
<tr>
<td>IE6,Firefox下测试通过。</td>
</tr>
<tr>
<td>调用方法(注意顺序):</td>
</tr>
<tr>
<td>var menuTab = new JMenuTab(null,null,"menuBar");<br />
menuTab.create();<br />
menuTab.addTab("首页");<br />
menuTab.addTab("组织架构","page1");<br />
menuTab.addTab("员工信息","page2");<br />
menuTab.addTab("业务知识","page3");
<br />
menuTab.addTab("Help","pageHelp");<br />
menuTab.setActiveTab(2);</td>
</tr>
</table>
</div>
</body>
</html>
<script language="javascript" type="text/javascript">
function JMenuTab(pWidth,pHeight,pBody){
var self = this;
//________________________________________________
var width = pWidth;
var height = pHeight;
var titleHeight = 24;
//________________________________________________
var oOutline = null;
var oTitleOutline = null;
var oPageOutline = null;
var oTitleArea = null;
var oPageArea = null;
var tabArray = new Array();
var activedTab = null;
//________________________________________________
var $ = function(pObjId){
return document.getElementById(pObjId);
}
//________________________________________________
var body = $(pBody) || document.body;
//________________________________________________
var htmlObject = function(pTagName){
return document.createElement(pTagName);
}
//________________________________________________
var isRate = function(pRateString){
if(!isNaN(pRateString)) return false;
if(pRateString.substr(pRateString.length-1,1) != "%")
return false;
if(isNaN(pRateString.substring(0,pRateString.length - 1)))
return false;
return true;
}
//________________________________________________
var createOutline = function(){
oOutline = htmlObject("DIV");
body.appendChild(oOutline);
oOutline.className = "oOutline";
}
//________________________________________________
var createTitleOutline = function(){
oTitleOutline = htmlObject("DIV");
oOutline.appendChild(oTitleOutline);
oTitleOutline.className = "oTitleOutline";
var vTable = htmlObject("TABLE");
oTitleOutline.appendChild(vTable);
vTable.width = "100%";
vTable.border = 0;
vTable.cellSpacing = 0;
vTable.cellPadding = 0;
var vTBody = htmlObject("TBODY");
vTable.appendChild(vTBody);
var vTr1 = htmlObject("TR");
vTBody.appendChild(vTr1);
var vTdTopLeft = htmlObject("TD");
vTr1.appendChild(vTdTopLeft);
vTdTopLeft.height = titleHeight;
vTdTopLeft.className = "oTopLeft";
oTitleArea = htmlObject("TD");/////////////////////////////////
vTr1.appendChild(oTitleArea);
oTitleArea.className = "oTitleArea";
var vTdTopRight = htmlObject("TD");
vTr1.appendChild(vTdTopRight);
vTdTopRight.className = "oTopRight";
}
this.setTitleHeight = function(pHeight){
//设置标题区域的高度
}
//________________________________________________
var tabBtn_click = function(){
self.setActiveTab(this.index);
}
var tabBtn_mouseover = function(){
if(this.className =="oTabBtnActive")
return;
this.className = "oTabBtnHover";
}
var tabBtn_mouseout = function(){
if(this.className =="oTabBtnActive")
return;
this.className = "oTabBtn";
}
//________________________________________________
var createTabBtn = function(pLabel,pTabPage){
var vTabBtn = htmlObject("DIV");
oTitleArea.appendChild(vTabBtn);
vTabBtn.className = "oTabBtn";
vTabBtn.index = tabArray.length;
vTabBtn.tabPage = pTabPage;
vTabBtn.onclick = tabBtn_click;
vTabBtn.onmouseover = tabBtn_mouseover;
vTabBtn.onmouseout = tabBtn_mouseout;
tabArray.push(vTabBtn);
var vTabBtnL = htmlObject("DIV");
vTabBtn.appendChild(vTabBtnL);
vTabBtnL.className = "oTabBtnLeft";
vTabBtnC = htmlObject("DIV");
vTabBtn.appendChild(vTabBtnC);
vTabBtnC.className = "oTabBtnCenter";
vTabBtnC.innerHTML = pLabel;
vTabBtnR = htmlObject("DIV");
vTabBtn.appendChild(vTabBtnR);
vTabBtnR.className = "oTabBtnRight";
}
var createPageOutline = function(){
oPageOutline = htmlObject("DIV");
oOutline.appendChild(oPageOutline);
oPageOutline.className = "oPageOutline";
var vTable = htmlObject("TABLE");
oPageOutline.appendChild(vTable);
vTable.width = "100%";
vTable.border = 0;
vTable.cellSpacing = 0;
vTable.cellPadding = 0;
vTable.style.borderCollapse = "collapse";
vTable.style.tableLayout="fixed";
var vTBody = htmlObject("TBODY");
vTable.appendChild(vTBody);
var vTr1 = htmlObject("TR");
vTBody.appendChild(vTr1);
var vTdBottomLeft = htmlObject("TD");
vTr1.appendChild(vTdBottomLeft);
vTdBottomLeft.className = "oBottomLeft";
vTdBottomLeft.rowSpan = 2;
oPageArea = htmlObject("TD");///////////////////////////////////////
vTr1.appendChild(oPageArea);
oPageArea.className = "oPageArea";
if(oPageArea.filters)
oPageArea.style.cssText = "FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward');";
oPageArea.height = 10;
var vTdBottomRight = htmlObject("TD");
vTr1.appendChild(vTdBottomRight);
vTdBottomRight.className = "oBottomRight";
vTdBottomRight.rowSpan = 2;
var vTr2 = htmlObject("TR");
vTBody.appendChild(vTr2);
var vTdBottomCenter = htmlObject("TD");
vTr2.appendChild(vTdBottomCenter);
vTdBottomCenter.className = "oBottomCenter";
}
//________________________________________________
this.addTab = function (pLabel,pPageBodyId){
createTabBtn(pLabel,pPageBodyId);
if($(pPageBodyId)){
oPageArea.appendChild($(pPageBodyId));
$(pPageBodyId).style.display = "none";
}
}
//________________________________________________
this.setActiveTab = function(pIndex){
if(oPageArea.filters)
oPageArea.filters[0].apply();
if(activedTab != null){
activedTab.className = "oTabBtn";
if($(activedTab.tabPage))
$(activedTab.tabPage).style.display = "none";
}
activedTab = tabArray[pIndex];
activedTab.className = "oTabBtnActive";
if($(activedTab.tabPage))
$(activedTab.tabPage).style.display = "";
if(oPageArea.filters)
oPageArea.filters[0].play(duration=1);
};
//________________________________________________
this.create = function(){
createOutline();
createTitleOutline();
createPageOutline();
}
}
var menuTab = new JMenuTab(null,null,"menuBar");
menuTab.create();
menuTab.addTab("首页");
menuTab.addTab("组织架构","page1");
menuTab.addTab("员工信息","page2");
menuTab.addTab("业务知识","page3");
menuTab.addTab("ISO系统");
menuTab.addTab("办公环境");
menuTab.addTab("公司新闻");
menuTab.addTab("公共政策");
menuTab.addTab("链接总部");
menuTab.addTab("Help","pageHelp");
menuTab.setActiveTab(2);
</script>
请下载源码察看效果。
我就命名为:JMenuTab吧,因为写它是为了当我的菜单。
IE6,FireFox下测试通过。
复制代码 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="JTabRes1/JMenuTab.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
margin: 0px;
}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="200"> </td>
<td id="menuBar"></td>
</tr>
</table>
<div id="page1">大大小小多多少少<br />
人口手足</div>
<div id="page2">ABCDEFG</div>
<div id="page3"><img src="/UploadFiles/2021-04-02/loading.gif"><div id="pageHelp"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>JMenuTab 帮助:</td>
</tr>
<tr>
<td>Author:xling Blog:http://xling.blueidea.com 2007/05/23 </td>
</tr>
<tr>
<td>写这个程序只是为了解决燃眉之急(汉,虽然是急,我还是写了一天)!</td>
</tr>
<tr>
<td>程序中用到图片是修改了网上现有图片,所以,外表和某些网站上的一样,请不要见怪。因为除了图片,全是原创(不曾参考任何类似程序)!</td>
</tr>
<tr>
<td>IE6,Firefox下测试通过。</td>
</tr>
<tr>
<td>调用方法(注意顺序):</td>
</tr>
<tr>
<td>var menuTab = new JMenuTab(null,null,"menuBar");<br />
menuTab.create();<br />
menuTab.addTab("首页");<br />
menuTab.addTab("组织架构","page1");<br />
menuTab.addTab("员工信息","page2");<br />
menuTab.addTab("业务知识","page3");
<br />
menuTab.addTab("Help","pageHelp");<br />
menuTab.setActiveTab(2);</td>
</tr>
</table>
</div>
</body>
</html>
<script language="javascript" type="text/javascript">
function JMenuTab(pWidth,pHeight,pBody){
var self = this;
//________________________________________________
var width = pWidth;
var height = pHeight;
var titleHeight = 24;
//________________________________________________
var oOutline = null;
var oTitleOutline = null;
var oPageOutline = null;
var oTitleArea = null;
var oPageArea = null;
var tabArray = new Array();
var activedTab = null;
//________________________________________________
var $ = function(pObjId){
return document.getElementById(pObjId);
}
//________________________________________________
var body = $(pBody) || document.body;
//________________________________________________
var htmlObject = function(pTagName){
return document.createElement(pTagName);
}
//________________________________________________
var isRate = function(pRateString){
if(!isNaN(pRateString)) return false;
if(pRateString.substr(pRateString.length-1,1) != "%")
return false;
if(isNaN(pRateString.substring(0,pRateString.length - 1)))
return false;
return true;
}
//________________________________________________
var createOutline = function(){
oOutline = htmlObject("DIV");
body.appendChild(oOutline);
oOutline.className = "oOutline";
}
//________________________________________________
var createTitleOutline = function(){
oTitleOutline = htmlObject("DIV");
oOutline.appendChild(oTitleOutline);
oTitleOutline.className = "oTitleOutline";
var vTable = htmlObject("TABLE");
oTitleOutline.appendChild(vTable);
vTable.width = "100%";
vTable.border = 0;
vTable.cellSpacing = 0;
vTable.cellPadding = 0;
var vTBody = htmlObject("TBODY");
vTable.appendChild(vTBody);
var vTr1 = htmlObject("TR");
vTBody.appendChild(vTr1);
var vTdTopLeft = htmlObject("TD");
vTr1.appendChild(vTdTopLeft);
vTdTopLeft.height = titleHeight;
vTdTopLeft.className = "oTopLeft";
oTitleArea = htmlObject("TD");/////////////////////////////////
vTr1.appendChild(oTitleArea);
oTitleArea.className = "oTitleArea";
var vTdTopRight = htmlObject("TD");
vTr1.appendChild(vTdTopRight);
vTdTopRight.className = "oTopRight";
}
this.setTitleHeight = function(pHeight){
//设置标题区域的高度
}
//________________________________________________
var tabBtn_click = function(){
self.setActiveTab(this.index);
}
var tabBtn_mouseover = function(){
if(this.className =="oTabBtnActive")
return;
this.className = "oTabBtnHover";
}
var tabBtn_mouseout = function(){
if(this.className =="oTabBtnActive")
return;
this.className = "oTabBtn";
}
//________________________________________________
var createTabBtn = function(pLabel,pTabPage){
var vTabBtn = htmlObject("DIV");
oTitleArea.appendChild(vTabBtn);
vTabBtn.className = "oTabBtn";
vTabBtn.index = tabArray.length;
vTabBtn.tabPage = pTabPage;
vTabBtn.onclick = tabBtn_click;
vTabBtn.onmouseover = tabBtn_mouseover;
vTabBtn.onmouseout = tabBtn_mouseout;
tabArray.push(vTabBtn);
var vTabBtnL = htmlObject("DIV");
vTabBtn.appendChild(vTabBtnL);
vTabBtnL.className = "oTabBtnLeft";
vTabBtnC = htmlObject("DIV");
vTabBtn.appendChild(vTabBtnC);
vTabBtnC.className = "oTabBtnCenter";
vTabBtnC.innerHTML = pLabel;
vTabBtnR = htmlObject("DIV");
vTabBtn.appendChild(vTabBtnR);
vTabBtnR.className = "oTabBtnRight";
}
var createPageOutline = function(){
oPageOutline = htmlObject("DIV");
oOutline.appendChild(oPageOutline);
oPageOutline.className = "oPageOutline";
var vTable = htmlObject("TABLE");
oPageOutline.appendChild(vTable);
vTable.width = "100%";
vTable.border = 0;
vTable.cellSpacing = 0;
vTable.cellPadding = 0;
vTable.style.borderCollapse = "collapse";
vTable.style.tableLayout="fixed";
var vTBody = htmlObject("TBODY");
vTable.appendChild(vTBody);
var vTr1 = htmlObject("TR");
vTBody.appendChild(vTr1);
var vTdBottomLeft = htmlObject("TD");
vTr1.appendChild(vTdBottomLeft);
vTdBottomLeft.className = "oBottomLeft";
vTdBottomLeft.rowSpan = 2;
oPageArea = htmlObject("TD");///////////////////////////////////////
vTr1.appendChild(oPageArea);
oPageArea.className = "oPageArea";
if(oPageArea.filters)
oPageArea.style.cssText = "FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward');";
oPageArea.height = 10;
var vTdBottomRight = htmlObject("TD");
vTr1.appendChild(vTdBottomRight);
vTdBottomRight.className = "oBottomRight";
vTdBottomRight.rowSpan = 2;
var vTr2 = htmlObject("TR");
vTBody.appendChild(vTr2);
var vTdBottomCenter = htmlObject("TD");
vTr2.appendChild(vTdBottomCenter);
vTdBottomCenter.className = "oBottomCenter";
}
//________________________________________________
this.addTab = function (pLabel,pPageBodyId){
createTabBtn(pLabel,pPageBodyId);
if($(pPageBodyId)){
oPageArea.appendChild($(pPageBodyId));
$(pPageBodyId).style.display = "none";
}
}
//________________________________________________
this.setActiveTab = function(pIndex){
if(oPageArea.filters)
oPageArea.filters[0].apply();
if(activedTab != null){
activedTab.className = "oTabBtn";
if($(activedTab.tabPage))
$(activedTab.tabPage).style.display = "none";
}
activedTab = tabArray[pIndex];
activedTab.className = "oTabBtnActive";
if($(activedTab.tabPage))
$(activedTab.tabPage).style.display = "";
if(oPageArea.filters)
oPageArea.filters[0].play(duration=1);
};
//________________________________________________
this.create = function(){
createOutline();
createTitleOutline();
createPageOutline();
}
}
var menuTab = new JMenuTab(null,null,"menuBar");
menuTab.create();
menuTab.addTab("首页");
menuTab.addTab("组织架构","page1");
menuTab.addTab("员工信息","page2");
menuTab.addTab("业务知识","page3");
menuTab.addTab("ISO系统");
menuTab.addTab("办公环境");
menuTab.addTab("公司新闻");
menuTab.addTab("公共政策");
menuTab.addTab("链接总部");
menuTab.addTab("Help","pageHelp");
menuTab.setActiveTab(2);
</script>
请下载源码察看效果。
标签:
一个js实现的所谓的滑动门
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com
暂无“一个js实现的所谓的滑动门”评论...
《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线
暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。
艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。
《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。