JS+CSS實(shí)現(xiàn)的日本門戶網(wǎng)站經(jīng)典選項(xiàng)卡導(dǎo)航效果
本文實(shí)例講述了JS+CSS實(shí)現(xiàn)的日本門戶網(wǎng)站經(jīng)典選項(xiàng)卡導(dǎo)航效果。分享給大家供大家參考。具體如下:
這里介紹的是來自日本門戶網(wǎng)站的一款CSS+JavaScript選項(xiàng)卡導(dǎo)航菜單,銀灰色風(fēng)格,看來日本人和中國人的審美是接近的,都喜歡這種風(fēng)格,如果你要用的話,直接拷貝代碼部分到你的網(wǎng)頁中,注意你需要修改編碼才行,日本的編碼和中國可是不一樣哦,只要把文字改為中國的就行了。
運(yùn)行效果截圖如下:

在線演示地址如下:
http://demo.jb51.net/js/2015/js-css-japan-web-nav-demo/
具體代碼如下:
<HTML>
<HEAD>
<title>日本門戶網(wǎng)站的經(jīng)典選項(xiàng)卡導(dǎo)航</title>
<style type="text/css">
*{margin:0; padding:0;}
body{
padding:0;
margin:0;
font-size:8pt;
_font-size:x-small;
color:#333;
background:#FFF;
line-height:1.3em;
word-break:break-all;
}
#TabNews{
width:403px; padding:0; min-height:260px; border: 1px solid rid;
margin:39px;
}
#News-navi{background:url(images/bg_navi.gif) 0 100% no-repeat;background-color:#FFFFFF !important; width:405px;}
#News-navi li{float:left; list-style:none;}
#News-navi #News01{width:102px;}
#News-navi #News02{width:76px;}
#News-navi #News03{width:76px;}
#News-navi #News04{width:76px;}
#News-navi #News05{width:75px;}
#News-navi a{background:url(images/bg_navi.gif) 0 0 no-repeat;padding-top:1px;display:block;line-height:1.1;min-height:22px;_height:23px;text-align:center;}
#News-navi a span{display:block;padding:3px 0 0;}
#News-navi #News01 a{background-position:0 0;}
#News-navi #News02 a{background-position:-102px 0;}
#News-navi #News03 a{background-position:-178px 0;}
#News-navi #News04 a{background-position:-254px 0;}
#News-navi #News05 a{background-position:-330px 0;}
#News-navi .focus a{font-weight:bold;color:#333333;}
#News-navi #News01.focus a{background-position:-405px 0;}
#News-navi #News02.focus a{background-position:-507px 0;}
#News-navi #News03.focus a{background-position:-583px 0;}
#News-navi #News04.focus a{background-position:-659px 0;}
#News-navi #News05.focus a{background-position:-735px 0;}
#News .news-content .dot li,#News .news-content .dot dd{padding-bottom:3px;}
#News .news-content .dot li a,#News .news-content .dot dd a{padding-left:10px;}
#News .more-content .dot li a,#News .more-content .dot dd a{background-position:-196px -546px;padding-left:6px;}
#News{ min-height:238px;_height:238px; width:403px;border:1px solid #c4c4c4;margin-bottom:10px;border-top:none; background:#FFF;}
#News .pkg{width:393px; padding: 5px;}
#News .arrR{background-position:-187px -298px;}
#News #cocoCeleb{width:187px;}
#News .news-content{width:206px; line-height:1.4;}
#News .more-content{width:190px;}
#News .new{ background-position:1px -140px;*background-position:1px -142px;}
</style>
<SCRIPT type="text/javascript" >
function $()
{var C=new Array();for(var B=0;B<arguments.length;B++)
{var A=arguments[B];
if(typeof A=="string")
{if(document.getElementById){A=document.getElementById(A)}else{if(document.all){A=document.all(A)}}}if(arguments.length==1){return A}C.push(A)}return C};
function tabclick(A)
{if($("News0"+A).className!="focus")
{settab(A);saveCookie("ntab",A,200);return false}}
function settab(A)
{
for(i=1;i<6;i++)
{
if(i==A)
{$("News0"+i).className="focus";$("newsArea0"+i).style.display="block"}else{$("News0"+i).className="";$("newsArea0"+i).style.display= "none"}
}}
function saveCookie(D,E,B)
{var C=arguments.length>2?B:"200";var A=new Date();A.setTime(A.getTime()+1000*60*60*24*(C));var F=A.toGMTString();document.cookie=D+"="+escape(E)+"; expires="+F+"; path=/;"}
</SCRIPT>
</HEAD>
<BODY>
<div id="TabNews">
<UL id="News-navi" class="pkg">
<LI id="News01" class="focus"><A href="#" hidefocus="true" onclick="return tabclick(1);" ><SPAN>Codes</SPAN></A></LI>
<LI id="News02" class=""><A href="#" hidefocus="true" onclick="return tabclick(2);" ><SPAN>ASP</SPAN></A></LI>
<LI id="News03" class=""><A href="#" hidefocus="true" onclick="return tabclick(3);" ><SPAN>PHP</SPAN></A></LI>
<LI id="News04" class=""><A href="#" hidefocus="true" onclick="return tabclick(4);" ><SPAN>JSP</SPAN></A></LI>
<LI id="News05" class=""><A href="#" hidefocus="true" onclick="return tabclick(5);" ><SPAN>DELPHI</SPAN></A></LI>
</UL><DIV class="box hslice" id="News">
<DIV id="newsArea01" class="pkg pddT10" style="display: block; ">
<a href="#" target="_blank">那個(gè)年少輕狂的年代,已經(jīng)一去不回!</a>
</DIV>
<DIV id="newsArea02" class="pkg pddT10" style="display: none; ">
<a href="#" target="_blank">ASP</a>
</DIV>
<DIV id="newsArea03" class="pkg pddT10" style="display: none; ">
<a href="#" target="_blank">PHP</a></DIV>
<DIV id="newsArea04" class="pkg pddT10" style="display: none; ">
<a href="#" target="_blank">Jsp</a> </DIV>
<DIV id="newsArea05" class="pkg pddT10" style="display: none; ">
<a href="#" target="_blank">Delphi</a>
</DIV>
</DIV>
</div>
</div>
</BODY>
</HTML>
希望本文所述對(duì)大家的JavaScript程序設(shè)計(jì)有所幫助。
- 一步步教大家編寫酷炫的導(dǎo)航欄js+css實(shí)現(xiàn)
- JS實(shí)現(xiàn)選中當(dāng)前菜單后高亮顯示的導(dǎo)航條效果
- JS利用cookie記憶當(dāng)前位置的防刷新導(dǎo)航效果
- JS實(shí)現(xiàn)的簡(jiǎn)潔二級(jí)導(dǎo)航菜單雛形效果
- JS實(shí)現(xiàn)帶圓弧背景漸變效果的導(dǎo)航菜單代碼
- js實(shí)現(xiàn)多選項(xiàng)切換導(dǎo)航菜單的方法
- CSS3+Js實(shí)現(xiàn)響應(yīng)式導(dǎo)航條
- js導(dǎo)航欄單擊事件背景變換示例代碼
- JavaScript導(dǎo)航腳本判斷當(dāng)前導(dǎo)航
相關(guān)文章
JS實(shí)現(xiàn)控制表格只顯示行邊框或者只顯示列邊框的方法
這篇文章主要介紹了JS實(shí)現(xiàn)控制表格只顯示行邊框或者只顯示列邊框的方法,涉及javascript使用表格對(duì)象的rules屬性的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-03-03
解決axios會(huì)發(fā)送兩次請(qǐng)求,有個(gè)OPTIONS請(qǐng)求的問題
這篇文章主要介紹了解決axios會(huì)發(fā)送兩次請(qǐng)求,有個(gè)OPTIONS請(qǐng)求的問題,需要的朋友可以參考下2018-10-10
使用3D引擎threeJS實(shí)現(xiàn)星空粒子移動(dòng)效果
這篇文章主要為大家詳細(xì)介紹了使用3D引擎threeJS實(shí)現(xiàn)星空粒子移動(dòng)效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-11-11
JavaScript實(shí)現(xiàn)搜索框的自動(dòng)完成功能(一)
在很多需要搜索的網(wǎng)站, 都會(huì)有一個(gè)自動(dòng)完成的搜索框. 方便用戶查找他們想要的搜索詞. 幫助用戶快速找到自己想要的結(jié)果.接下來通過本文給大家介紹JavaScript實(shí)現(xiàn)搜索框的自動(dòng)完成功能(一),需要的朋友參考下吧2016-02-02

