代码驿站移动版
频道导航
HTML/Xhtml
CSS
JavaScript
HTML5
PHP教程
ASP.NET
正则表达式
AJAX
ThinkPHP
Yii
MySQL
MariaDB
Oracle
MongoDB
Redis
DedeCMS
PHPCMS
帝国CMS
WordPress
Discuz
其它CMS
Zend Studio
Sublime
Notepad
Dreamweaver
Windows
Linux
Nginx
Apache
IIS
CentOS
Ubuntu
Debian
网站优化
工具资源
PHP源码
ASP.NET源码
其它源码
图标素材
按钮素材
字体素材
DedeCMS模板
帝国CMS模板
PHPCMS模板
WordPress模板
Discuz!模板
单页模板
开发软件下载
服务器软件下载
广告投放
联系我们
版权申明
软件编程
网页前端
移动开发
数据库
服务器
脚本语言
PHP代码
JAVA代码
Python代码
Android代码
当前位置:
主页
>
网页前端
>
JavaScript代码
>
javascript渐变显示的雅虎中国选项卡效果代码
时间:2020-11-24 16:43:51 | 栏目:
JavaScript代码
| 点击:次
<!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=gb2312" /> <title>y</title> <style type="text/css"> body { margin: 0; text-align: center; font-size: 12px; } .papanel, .pabd, .paft, .patop {width: 348px;} .papanel { background: #a5d0fd url("/article/upimages/pabg.gif") repeat-x; border-left: 1px solid #7bbdff; border-right: 1px solid #7bbdff; font-family: arial; } .pabd { clear: both; overflow: hidden; padding-bottom: .35em; background: url("/article/upimages/patbg.gif") no-repeat top left; } .patop{ height: 25px; line-height: 20px; overflow: hidden; } /*顶部圆角开始*/ .pabdt { background: url("/article/upimages/pabdr.gif") 0 0 no-repeat; width: 350px; height: 4px; overflow: hidden; } .pabdb { background: url("/article/upimages/pabdr.gif") 0 -4px no-repeat; width: 350px; height: 3px; overflow: hidden; } /*顶部圆角结束*/ .tabWin { width: 340px; margin: 0 auto; } .tabWin .TabTitle { margin: .25em 0 0 0; padding: 0; list-style: none; height: 40px; } .tabWin .TabTitle li { float: left; position: relative; width: 112px; height: 40px; line-height: 40px; text-align: center; } .tabWin .TabTitle li a { display: block; width: 109px; height: 40px; } /*内置背景开始*/ .tabWin .TabContent { position: relative; clear: both; width: 338px; margin: 0 auto; background: #fff; border-left: 1px solid #85c3ff; border-right: 1px solid #5ca3e9; display: block; } /*外部小图标开始*/ .tabWin .icomailn { background: url("/article/upimages/tabicmln.gif") 0 0 no-repeat; } .tabWin .icomail { background: url("/article/upimages/tabicml.gif") 0 0 no-repeat; } .tabWin .icoalb { background: url("/article/upimages/tabicalb.gif") 0 0 no-repeat; } .tabWin .icomus { background: url("/article/upimages/tabicmus.gif") 0 0 no-repeat; } .tabWin .icofin { background: url("/article/upimages/tabicfin.gif") 0 0 no-repeat; } .tabWin .icoalqq { background: url("/article/upimages/tabicfin.gif") 0 0 no-repeat; } /*正常*/ .tabWin .tabWinNormal{ background: url("/article/upimages/patabs1.gif") no-repeat; } /*1*/ .tabWin .tabWinAtive1 { background: url("/article/upimages/patabsa.gif") no-repeat; } /*2*/ .tabWin .tabWinAtive2 { background: url("/article/upimages/patabsb.gif") no-repeat; } /*3*/ .tabWin .tabWinAtive3 { background: url("/article/upimages/patabsc.gif") no-repeat; } #patabs1 strong, #patabs2 strong{ color: #0062c5; font-size: 13px; margin-left: 2em; } .tabWin .none { height:150px; text-align:center; display:none; filter:revealtrans(transition=22,duration=0.5) blendtrans(duration=0.5) alpha(opacity=97) progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#FFFFFF,endColorStr=#EBF0F4); } </style> <script language="javascript"> var waitInterval; var mouseDelayTime = 200; /*选项窗*/ function tabWinMouseOver(tabWinObj,tabWinTotal,obj) { window.clearTimeout(waitInterval); waitInterval=window.setTimeout("ChangeDiv3('"+tabWinObj+"',"+tabWinTotal+","+obj.id+")",mouseDelayTime) } function ChangeDiv3(tabWinObj,tabWinTotal,obj) { var n,itemNum; for(var i=1;i<tabWinTotal+1;i++) { if (tabWinObj+"_Title"+i == obj.id) { itemNum = i; //document.getElementById(tabWinObj+"_Content"+i).className = "block"; TransitionEffect(tabWinObj+"_Content"+i,'x',1); }else{ //document.getElementById(tabWinObj+"_Content"+i).className = "none"; TransitionEffect(tabWinObj+"_Content"+i,'x',0); } } var tabPatabs1 = document.getElementById("patabs1"); var tabPatabs2 = document.getElementById("patabs2"); if(tabPatabs1!=null && tabPatabs2!=null) { if (itemNum >= 4){n = itemNum - 3;}else{n = itemNum}; if(itemNum < 4) { tabPatabs1.className = "TabTitle tabWinAtive"+n; tabPatabs2.className = "TabTitle tabWinNormal"; }else{ tabPatabs1.className = "TabTitle tabWinNormal"; tabPatabs2.className = "TabTitle tabWinAtive"+n; } } } function tabMouseOut(){ window.clearTimeout(waitInterval); } /*过渡效果*/ function TransitionEffect(DivID,Cur,DoType) { var display = (DoType == 1)?"block":"none"; if (($(DivID) != null)){if (Cur != 'x'){$(DivID).filters.revealTrans.Transition = Cur;$(DivID).filters.revealTrans.apply();$(DivID).style.display = display; $(DivID).filters.revealTrans.play();}else{$(DivID).filters.blendTrans.apply();$(DivID).style.display = display; $(DivID).filters.blendTrans.play();};}; } function $(){var elements = new Array();for (var i = 0; i < arguments.length; i++) {var element = arguments[i];if (typeof element == 'string'){if(document.getElementById(element)){element = document.getElementById(element);}else{element = document.getElementsByName(element);}if (arguments.length == 1){return element;}}elements.push(element);}return elements;}; </script> </head> <body> <div class="pabdt"> </div> <div class="papanel"> <div class="pabd"> <div class="patop"> <strong>乐为</strong> </div> <!-- 选项卡开始 --> <div class="tabWin"> <ul class="TabTitle tabWinNormal" id="patabs1"> <li id="tabWin_Title1" onmouseover="tabWinMouseOver('tabWin',6,this);" onmouseout="tabMouseOut();"><a href="javascript:void(0);" class="icomus"> <strong>电影</strong></a></li> <li id="tabWin_Title2" onmouseover="tabWinMouseOver('tabWin',6,this);" onmouseout="tabMouseOut();"><a href="javascript:void(0);" class="icoalb"> <strong>电视剧</strong></a></li> <li id="tabWin_Title3" onmouseover="tabWinMouseOver('tabWin',6,this);" onmouseout="tabMouseOut();"><a href="javascript:void(0);" class="icomail"> <strong>体育节目</strong></a></li> </ul> <div class="TabContent"> <div id="tabWin_Content1" class="none"> 111 </div> <div id="tabWin_Content2" class="none"> 222 </div> <div id="tabWin_Content3" class="none"> 333 </div> </div> </div> <!-- 选项卡结束 --> <!-- 选项卡开始 --> <div class="tabWin"> <ul class="TabTitle tabWinNormal" id="patabs2"> <li id="tabWin_Title4" onmouseover="tabWinMouseOver('tabWin',6,this);" onmouseout="tabMouseOut();"><a href="javascript:void(0);" class="icoalqq"> <strong>网络游戏</strong></a></li> <li id="tabWin_Title5" onmouseover="tabWinMouseOver('tabWin',6,this);" onmouseout="tabMouseOut();"><a href="javascript:void(0);" class="icofin"> <strong>单机游戏</strong></a></li> <li id="tabWin_Title6" onmouseover="tabWinMouseOver('tabWin',6,this);" onmouseout="tabMouseOut();"><a href="javascript:void(0);" class="icomailn"> <strong>手机游戏</strong></a></li> </ul> <div class="TabContent"> <div id="tabWin_Content4" class="none"> ddesse </div> <div id="tabWin_Content5" class="none"> 555 </div> <div id="tabWin_Content6" class="none"> 666 </div> </div> </div> <!-- 选项卡结束 --> </div> </div> <div class="pabdb"> </div> </body> </html>
[Ctrl+A 全选 注:
引入外部Js需再刷新一下页面才能执行
]
您可能感兴趣的文章:
JavaScript常见事件处理程序实例总结
url传递的参数值中包含&时,url自动截断问题的解决方法
Javascript的匿名函数小结
javascript上下左右定时滚动插件
Javascript别踩白块儿(钢琴块儿)小游戏实现代码
相关文章
11-08
兼容浏览器的js事件绑定函数(详解)
11-27
Javascript实例教程(19) 使用HoTMetal(2)
11-23
Webpack中loader打包各种文件的方法实例
10-05
javascript判断图片是否加载完成的方法推荐
11-22
在javascript中执行任意html代码的方法示例解读
JQuery
VUE
AngularJS
MSSql
MySQL
MongoDB
Redis
Linux
Tomcat
Nginx
网站首页
广告投放
联系我们
版权申明
联系站长