JS+CSS實(shí)現(xiàn)的藍(lán)色table選項(xiàng)卡效果
本文實(shí)例講述了JS+CSS實(shí)現(xiàn)的藍(lán)色table選項(xiàng)卡效果。分享給大家供大家參考。具體如下:
這是一款藍(lán)色的JS+Table類型的選項(xiàng)卡,部分標(biāo)簽內(nèi)容存儲(chǔ)在JS數(shù)組,個(gè)人感覺本特效不是太合理,因?yàn)閮?nèi)容從Js里輸出會(huì)給讀取內(nèi)容造成很大麻煩,這里你就當(dāng)學(xué)習(xí)一種JS編程方法,代碼是需要改進(jìn)的。
先來看看運(yùn)行效果截圖:
在線演示地址如下:
http://demo.jb51.net/js/2015/js-css-blue-table-style-nav-demo/
具體代碼如下:
<html> <head> <title>選項(xiàng)卡</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style> td,a,body{font-size:9pt;color:#000000;} .DivAround_focus{cursor:pointer;background-color:#A1ACDB;border-right:solid 1px #A1ACDB;border-bottom:solid 1px #333333; border-left:solid 1px #C8CEEA; border-top:solid 1px #C8CEEA} .DivAround_blur{cursor:pointer;background:#4D5C9F;border-right:solid 1px #eeeeee;border-bottom:solid 1px #333333; border-left:solid 1px #798ACC; border-top:solid 1px #A1ACDB;color:#FFFFFF} .DivAround_content{background-color:#A1ACDB;border-right:solid 1px #888888;border-bottom:solid 1px #555555; border-left:0px; border-top:solid 1px #C8CEEA;} </style> </head> <body> <script language="javascript"> var AroundInfoArray=new Array(); AroundInfoArray[0]="腳本資源"; AroundInfoArray[1]="網(wǎng)頁技巧集"; AroundInfoArray[2]="IT資訊坊"; function ChangeFocus(obj) { for(i=0;i<document.getElementById("leftButtonTAble").rows.length;i++) { if(document.getElementById("leftButtonTAble").rows[i].cells[0]==obj) { document.getElementById("leftButtonTAble").rows[i].cells[0].className="DivAround_focus"; document.getElementById("DivAroundContent").innerHTML=AroundInfoArray[i]; }else{ document.getElementById("leftButtonTAble").rows[i].cells[0].className="DivAround_blur"; } } } </script> <table cellpadding="0" cellspacing="0" border="0" align="center" bgcolor="#6271B1"><tr><td width="84" valign="top"> <table cellpadding="0" cellspacing="0" border="0" height="407" width="84" id="leftButtonTAble"> <tr><td height="25" align="center" class="DivAround_focus" onClick="ChangeFocus(this)">腳本代碼</td></tr> <tr><td height="25" align="center" class="DivAround_blur" onClick="ChangeFocus(this)">網(wǎng)頁技巧</td></tr> <tr><td height="25" align="center" class="DivAround_blur" onClick="ChangeFocus(this)">IT坊</td></tr> <tr><td style="border-right:solid 1px #eeeeee"> </td></tr> </table> </td><td width="360"> <table cellpadding="0" cellspacing="0" border="0" width="100%" class="DivAround_content"> <tr><td height="406" valign="top" style="padding:4px" id="DivAroundContent">內(nèi)容</td></tr> </table> </td></tr> </table> <script language="javascript">ChangeFocus(document.getElementById("leftButtonTAble").rows[0].cells[0]); </script> </body> </html>
希望本文所述對(duì)大家的JavaScript程序設(shè)計(jì)有所幫助。
- JS實(shí)現(xiàn)的樣式切換功能tableCSS實(shí)例
- 利用js+css+html實(shí)現(xiàn)固定table的列頭不動(dòng)
- 基于HTML+CSS+JS實(shí)現(xiàn)增加刪除修改tab導(dǎo)航特效代碼
- JS+CSS實(shí)現(xiàn)的經(jīng)典tab選項(xiàng)卡效果代碼
- js+css實(shí)現(xiàn)的圓角邊框TAB選項(xiàng)卡滑動(dòng)門代碼分享(2款)
- JS+CSS實(shí)現(xiàn)滑動(dòng)切換tab菜單效果
- HTML+CSS+JS實(shí)現(xiàn)完美兼容各大瀏覽器的TABLE固定列
- css配合JavaScript實(shí)現(xiàn)tab標(biāo)簽切換效果
相關(guān)文章
javaScript 數(shù)值型和字符串型之間的轉(zhuǎn)換
javaScript 數(shù)值型和字符串型之間的轉(zhuǎn)換2009-07-07js實(shí)現(xiàn)簡(jiǎn)單的點(diǎn)名器隨機(jī)色實(shí)例代碼
這篇文章主要給大家介紹了關(guān)于js實(shí)現(xiàn)簡(jiǎn)單的點(diǎn)名器隨機(jī)色的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-09-09javascript對(duì)象的property和prototype是這樣一種關(guān)系
javascript對(duì)象的property和prototype是這樣一種關(guān)系...2007-03-03用JavaScript實(shí)現(xiàn)用一個(gè)DIV來包裝文本元素節(jié)點(diǎn)
當(dāng)我試圖將文本(可能也包含HTML元素)用一個(gè)DIV元素包起來時(shí),可以使用下面的方法,需要的朋友可以參考下2014-09-09js仿蘋果iwatch外觀的計(jì)時(shí)器代碼分享
這篇文章主要介紹了JS+CSS3實(shí)現(xiàn)的類似于蘋果iwatch計(jì)時(shí)器特效,很實(shí)用的代碼,推薦給大家,有需要的小伙伴可以參考下。2015-08-08js 能實(shí)現(xiàn)監(jiān)聽F5頁面刷新子iframe 而父頁面不刷新的方法
下面小編就為大家?guī)硪黄猨s 能實(shí)現(xiàn)監(jiān)聽F5頁面刷新子iframe 而父頁面不刷新的方法。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2016-11-11javascript實(shí)現(xiàn)的動(dòng)態(tài)添加表單元素input,button等(appendChild)
這篇文章給大家介紹了javascript實(shí)現(xiàn)的動(dòng)態(tài)添加表單元素input,button等(appendChild)的實(shí)例代碼,非常不錯(cuò),具有一定的參考借鑒價(jià)值,需要的朋友參考下吧2007-11-11新浪微博字?jǐn)?shù)統(tǒng)計(jì) textarea字?jǐn)?shù)統(tǒng)計(jì)實(shí)現(xiàn)代碼
從新浪微博代碼里抄的,非常不錯(cuò),需要的朋友可以參考下。2011-08-08