JS实现不规则TAB选项卡效果代码
作者:bea
本文实例讲述了JS实现不规则TAB选项卡效果代码。分享给大家供大家参考。具体如下: 这是一款不规则TAB选项卡效果,将中规中矩的方角换成了不规则的圆角,也就是这一换,倒让浏览者新鲜了不少,也使选项卡增多了几份灵感,不是吗? 运行效果截图如下: 在线演示地址如下: http://demo./js/2015/js-box-tab-nav-style-menu-codes/ 具体代码如下: <html><head><meta http-equiv
本文实例讲述了JS实现不规则TAB选项卡效果代码。分享给大家供大家参考。具体如下:
这是一款不规则TAB选项卡效果,将中规中矩的方角换成了不规则的圆角,也就是这一换,倒让浏览者新鲜了不少,也使选项卡增多了几份灵感,不是吗?
运行效果截图如下:
在线演示地址如下:
http://demo./js/2015/js-box-tab-nav-style-menu-codes/
具体代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>不规则TAB选项卡效果</title>
<style type="text/css">
<!--
body,td{font-size: 12px;}
.tab{margin-top:100px}
#TabCon1{width:212px;height:100px;line-height:100px;border-left:#757575 1px solid;border-bottom:#757575 1px solid;border-right:#757575 1px solid;}
#TabCon2{width:212px;height:100px;line-height:100px;border-left:#757575 1px solid;border-bottom:#757575 1px solid;border-right:#757575 1px solid;}
.xixi1{width:212px;height:29px;line-height:29px;background-image:url(images/news_bghover1.gif);cursor:pointer;}
.xixi2{width:212px;height:29px;line-height:29px;background-image:url(images/news_bghover2.gif);cursor:pointer;}
.tab1{width:96px;height:29px;line-height:29px;float:left;text-align:center;cursor:pointer; color:#FFF;}
.tab2{width:116px;height:29px;line-height:29px;float:left;text-align:center;cursor:pointer;color:#000;}
-->
</style>
</head>
<body style="text-align:center">
<script type="text/javascript">
function setTab03Syn ( i )
{
selectTab03Syn(i);
}
function selectTab03Syn ( i )
{
switch(i){
case 1:
document.getElementById("TabCon1").style.display="block";
document.getElementById("TabCon2").style.display="none";
document.getElementById("font1").style.color="#ffffff";
document.getElementById("font2").style.color="#000000";
break;
case 2:
document.getElementById("TabCon1").style.display="none";
document.getElementById("TabCon2").style.display="block";
document.getElementById("font1").style.color="#000000";
document.getElementById("font2").style.color="#ffffff";
break;
}
}
</script>
<div class="tab">
<div id="bg" class="xixi1">
<div id="font1" class="tab1" onMouseOver="setTab03Syn(1);document.getElementById('bg').className='xixi1'">新闻标签</div>
<div id="font2" class="tab2" onMouseOver="setTab03Syn(2);document.getElementById('bg').className='xixi2'">新闻标签</div>
</div>
<div id="TabCon1">不规则TAB选项卡效果</div>
<div id="TabCon2" style="display:none">不规则TAB选项卡效果2</div>
</div>
</body>
</html>
希望本文所述对大家的JavaScript程序设计有所帮助。
有用 | 无用
这是一款不规则TAB选项卡效果,将中规中矩的方角换成了不规则的圆角,也就是这一换,倒让浏览者新鲜了不少,也使选项卡增多了几份灵感,不是吗?
运行效果截图如下:
在线演示地址如下:
http://demo./js/2015/js-box-tab-nav-style-menu-codes/
具体代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>不规则TAB选项卡效果</title>
<style type="text/css">
<!--
body,td{font-size: 12px;}
.tab{margin-top:100px}
#TabCon1{width:212px;height:100px;line-height:100px;border-left:#757575 1px solid;border-bottom:#757575 1px solid;border-right:#757575 1px solid;}
#TabCon2{width:212px;height:100px;line-height:100px;border-left:#757575 1px solid;border-bottom:#757575 1px solid;border-right:#757575 1px solid;}
.xixi1{width:212px;height:29px;line-height:29px;background-image:url(images/news_bghover1.gif);cursor:pointer;}
.xixi2{width:212px;height:29px;line-height:29px;background-image:url(images/news_bghover2.gif);cursor:pointer;}
.tab1{width:96px;height:29px;line-height:29px;float:left;text-align:center;cursor:pointer; color:#FFF;}
.tab2{width:116px;height:29px;line-height:29px;float:left;text-align:center;cursor:pointer;color:#000;}
-->
</style>
</head>
<body style="text-align:center">
<script type="text/javascript">
function setTab03Syn ( i )
{
selectTab03Syn(i);
}
function selectTab03Syn ( i )
{
switch(i){
case 1:
document.getElementById("TabCon1").style.display="block";
document.getElementById("TabCon2").style.display="none";
document.getElementById("font1").style.color="#ffffff";
document.getElementById("font2").style.color="#000000";
break;
case 2:
document.getElementById("TabCon1").style.display="none";
document.getElementById("TabCon2").style.display="block";
document.getElementById("font1").style.color="#000000";
document.getElementById("font2").style.color="#ffffff";
break;
}
}
</script>
<div class="tab">
<div id="bg" class="xixi1">
<div id="font1" class="tab1" onMouseOver="setTab03Syn(1);document.getElementById('bg').className='xixi1'">新闻标签</div>
<div id="font2" class="tab2" onMouseOver="setTab03Syn(2);document.getElementById('bg').className='xixi2'">新闻标签</div>
</div>
<div id="TabCon1">不规则TAB选项卡效果</div>
<div id="TabCon2" style="display:none">不规则TAB选项卡效果2</div>
</div>
</body>
</html>
希望本文所述对大家的JavaScript程序设计有所帮助。
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- JQuery入门基础小实例(1)
- JQuery实现级联下拉框效果实例讲解
- JS+CSS实现精美的二级导航效果代码
- jQuery实现仿腾讯迷你首页选项卡效果代码
- jQuery实现仿美橙互联两级导航菜单效果完整实例
- JS实现无限级网页折叠菜单(类似树形菜单)效果代码
- jQuery实现折叠、展开的菜单组效果代码
- ANGULARJS中使用JQUERY分页控件
- js实现tab切换效果实例
- JS实现自动固定顶部的悬浮菜单栏效果
- jQuery图片轮播滚动切换代码分享
- JS实现光滑展开合拢的菜单效果代码
- jQuery实现两款有动画功能的导航菜单代码
- javascript中的previousSibling和nextSibling的正确用法
- Javascript实现商品秒杀倒计时(时间与服务器时间同步)
- JS+CSS实现的经典tab选项卡效果代码
- 使用JavaScript脚本无法直接改变Asp.net中Checkbox控件的Enable属性的解决方法
- jQuery实现的超酷苹果风格图标滑出菜单效果代码
- jQuery实现的简单折叠菜单(折叠面板)效果代码