javascript橫排豎排標準選項卡效果代碼_經驗交流
來源:互聯網
上載者:User
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="PRcss,xhtml,html,css,js,book,個人首頁,無聊,神經,懶惰" /> <meta name="description" content="PRcss的個人首頁,無聊的,神經的,懶惰的..." /> <meta name="Author" content="PRcss,qq:50198763" /> <meta name="Copyright" content="本頁著作權歸PRcss所有。All Rights Reserved" /> <title>PRcss的選項卡 www.jb51.net</title> <style type="text/css"> <!-- * { margin:0; padding:0; font-size:12px; font-weight:normal; } .jj { font-weight:bolder!important; } .box { border-top-color:#c00!important; } .pr { color:#060!important; } #tab01 { position:relative; width:336px; height:88px; padding-top:15px; margin:50px; overflow:hidden; } #tab01 h3 { position:relative; z-index:2; float:left; height:14px; padding:0 7px 0 8px; margin-left:-1px; border-left:solid 1px #ccc; border-right:solid 1px #fff; text-align:center; background:#fff; cursor:pointer; } #tab01 h3.up { height:18px; padding:5px 7px 0 7px; margin:-6px 0 0 0; border:solid #ccc; border-width:1px 1px 0; color:#c00; } #tab01 div { display:none; position:absolute; left:0; top:32px; z-index:1; width:324px; height:54px; padding:5px; border:solid 1px #ccc; color:#666; } #tab01 div.up { display:block; } #tab02 { position:relative; width:200px; margin:50px; border:solid #ccc; border-width:0 1px 1px; } #tab02 h4 { height:18px; line-height:18px; border:solid #ccc; border-width:1px 0; margin-bottom:-1px; text-align:center; background:#f6f6f6; cursor:pointer; } #tab02 h4.up { color:#c00; } #tab02 ol { display:none; height:54px; padding:5px; color:#666; } #tab02 ol.up { display:block; } #tab03 { position:relative; width:100px; margin:50px; } #tab03 h3 { position:relative; z-index:1; height:16px; padding-top:4px; margin-bottom:-1px; border:solid #ccc; border-width:1px 0 1px 1px; text-align:center; font-family:宋體; background:#eee; cursor:pointer; } #tab03 h3.up { z-index:3; color:#c00; background:#fff; } #tab03 div.tab { display:none; position:absolute; left:99px; top:0; z-index:2; width:300px; height:200px; padding:5px; border:solid 1px #ccc; color:#666; } #tab03 div.tab.up { display:block; } --> </style> </head> <body> <h3>首頁</h3> <p>嘿嘿,無視div原始class值。</p> <h3 class="pr">測試</h3> <p>繼續無視h3原始class值。</p> <h3>無聊</h3> <p>h3沒有值也可以~</p> <h3 class="box">傻蛋</h3> <p>div沒有值一樣可以~</p> <h4>首頁</h4> <ol class="pr"><li>嘿嘿,無視容器原始class值。</li></ol> <h4 class="box">測試</h4> <ol><li>繼續無視h3原始class值。</li></ol> <h4>無聊</h4> <ol><li>h3沒有值也可以~</li></ol> <h4 class="bb">傻蛋</h4> <ol><li>div沒有值一樣可以~</li></ol> <h3>首頁</h3> <p>嘿嘿,無視h3原始class值。</p> <h3>測試</h3> <p>繼續無視div原始class值。</p> <h3>無聊</h3> <p>h3沒有值也可以~</p> <h3 class="box">傻蛋</h3> <p>class值相似一樣也可以~</p><p>指定class後,即時再多一個div也行。</p> </body> </html>
[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]