js實作仿Windows風格標籤和按鈕效果實例_javascript技巧
本文範例講述了js實作仿Windows風格標籤和按鈕效果的方法。分享給大家供大家參考。具體實作方法如下:
<html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <head> <style type="text/css"> <!-- body{ font-family: 'MS Shell Dlg', 宋体, Tahoma; font-size: 12px; background-color: #336699; color:#000000; } td, div, input, textarea{ font-family: 'MS Shell Dlg', 宋体, Tahoma; font-size: 12px; cursor: default; } .title{ background-color: #000080; color:#fdf7d3; padding: 1; font-family:宋体; font-size:12px; } .up{ background-color: #cccccc; color:#000000; border: 2px outset #ffffff } .down{ background-color: #cccccc; border:2px inset #ffffff } .up1{ background-color: #cccccc; color: #000000; border: 1px outset #ffffff } .down1{ background-color:#cccccc; border:1px inset #ffffff } .l { background-color: #cccccc; height: 18px; border-left: 2px outset #ffffff; border-right: 2px outset #ffffff; color:#000000; border-top: 2px outset #ffffff; padding-top: 2; height:18 } .lc { background-color: #cccccc; height: 18px; border-left: 2px outset #ffffff; border-right: 2px outset #ffffff; color:#000000; border-top: 2px outset #ffffff; padding-top: 2; height:20 } .l-h{ background-color: #cccccc; border-left: 2px outset #ffffff ; border-top: 2px outset #ffffff; color:#000000; } .l-c{ background-color: #cccccc; border-top: 2px outset #ffffff } .l-r { background-color: #cccccc; border-right: 2px outset #ffffff; border-top: 2px outset #ffffff; color:#000000; } .l-hc{ background-color: #cccccc; border-left: 2px outset #ffffff; color:#000000; } .l-cc{ background-color: #cccccc; color:#000000; } .l-rc { background-color: #cccccc; border-right: 2px outset #ffffff; color:#000000; } td{ color:#000000; } --> </style> <title>显示属性</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head> <body style="border:outset 1 #ffffff;margin: 0;background-color: #cccccc;padding:3px" scroll=no> <SCRIPT LANGUAGE="JavaScript"> <!-- function restore() { td1.className="l"; td2.className="l"; td3.className="l"; td4.className="l"; td5.className="l"; td6.className="l"; td_1.className="l-h"; td_2.className="l-c"; td_3.className="l-c"; td_4.className="l-c"; td_5.className="l-c"; td_6.className="l-c"; w1.style.display="none"; w2.style.display="none"; w3.style.display="none"; w4.style.display="none"; w5.style.display="none"; w6.style.display="none"; } function c1() { td1.className="lc"; td_1.className="l-hc"; w1.style.display="block"; } function c2() { td2.className="lc"; td_2.className="l-cc"; w2.style.display="block"; } function c3() { td3.className="lc"; td_3.className="l-cc"; w3.style.display="block"; } function c4() { td4.className="lc"; td_4.className="l-cc"; w4.style.display="block"; } function c5() { td5.className="lc"; td_5.className="l-cc"; w5.style.display="block"; } function c6() { td6.className="lc"; td_6.className="l-cc"; w6.style.display="block"; } //--> </SCRIPT> <form name="free" method="post" target="_target"> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" width="400" height="61"> <tr> <td width="50" height="20" align="center" valign="bottom" onclick=restore();c1();> <div id="td1" class="lc">背景</div></td> <td width="50" height="20" align="center" valign="bottom" onclick=restore();c2();> <div id="td2" class="l">屏保</div></td> <td width="50" height="20" align="center" valign="bottom" onclick=restore();c3();> <div id="td3" class="l">外观</div></td> <td width="50" height="20" align="center" valign="bottom" onclick=restore();c4();> <div id="td4" class="l">Web</div></td> <td width="50" height="20" align="center" valign="bottom" onclick=restore();c5();> <div id="td5" class="l">效果</div></td> <td width="50" height="20" align="center" valign="bottom" onclick=restore();c6();> <div id="td6" class="l">设置</div></td> <td width="50" height="20" align="center" valign="bottom" ></td> <td width="50" height="20" align="center" valign="bottom"></td> </tr> <tr > <td width="50" height="1" align="center" class="l-hc" id="td_1" > </td> <td width="50" height="1" align="center" class="l-c" id="td_2"> </td> <td width="50" height="1" align="center" class="l-c" id="td_3"> </td> <td width="50" height="1" align="center" class="l-c" id="td_4"> </td> <td width="50" height="1" align="center" class="l-c" id="td_5"> </td> <td width="50" height="1" align="center" class="l-c" id="td_6"> </td> <td width="50" height="1" align="center" class="l-c" id="td_"> </td> <td width="50" height="1" align="center" class="l-r" id="td_"> </td> </tr> <tr> <td width="398" height="360" class="up" colspan="8" style="border-top-style: solid; border-top-width: 0; padding: 5"> <p align="center"> <div align="center"> <table border="0" cellpadding="0" cellspacing="0" width="100%" height="325"> <tr> <td width="100%" height="280"> <div align="center"> <center> <div style="display:" id=w1><h1>1</h1></div> <div style="display:none" id=w2><h1>2</h1></div> <div style="display:none" id=w3><h1>3</h1></div> <div style="display:none" id=w4><h1>4</h1></div> <div style="display:none" id=w5><h1>5</h1></div> <div style="display:none" id=w6><h1>6</h1></div> </center> </div> </td> </tr> </table> </div> </td> </tr> </center> <tr> <td width="398" height="37" colspan="8" style="border-top-style: solid; border-top-width: 0; padding: 5"> <p align="right"><input type="button" value="确定" name="_ok" style="width: 60;height:22" class="up"> <input type="button" value="取消" name="_cancel" style="width: 60;height:22" class="up" onclick="window.close();"> <input type="button" value="应用(A)" name="_apply" style="width: 60;height:22" disabled class="up"> </td> </tr> </table> </div> </form> </body> </html>
運作效果如下:
希望本文所述對大家的javascript程式設計有所幫助。

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

熱門話題

如何使用JS和百度地圖實現地圖平移功能百度地圖是一款廣泛使用的地圖服務平台,在Web開發中經常用於展示地理資訊、定位等功能。本文將介紹如何使用JS和百度地圖API實作地圖平移功能,並提供具體的程式碼範例。一、準備工作使用百度地圖API前,首先需要在百度地圖開放平台(http://lbsyun.baidu.com/)上申請一個開發者帳號,並建立一個應用程式。創建完成

人臉偵測辨識技術已經是一個比較成熟且應用廣泛的技術。而目前最廣泛的網路應用語言非JS莫屬,在Web前端實現人臉偵測辨識相比後端的人臉辨識有優勢也有弱勢。優點包括減少網路互動、即時識別,大大縮短了使用者等待時間,提高了使用者體驗;弱勢是:受到模型大小限制,其中準確率也有限。如何在web端使用js實現人臉偵測呢?為了實現Web端人臉識別,需要熟悉相關的程式語言和技術,如JavaScript、HTML、CSS、WebRTC等。同時也需要掌握相關的電腦視覺和人工智慧技術。值得注意的是,由於Web端的計

您的Windows筆記型電腦無法啟動的原因可能有很多。記憶體故障、電池耗盡、電源按鈕故障或硬體問題都是常見原因。下面提供了一些解決方案,幫助您解決這個問題。按下電源按鈕後筆記型電腦無法啟動如果您的Windows筆記型電腦在按下電源按鈕後仍無法啟動,您可以採取以下步驟來解決問題:你的筆記本充滿電了嗎?執行硬重置清理你的筆記型電腦重新拔插內存透明的CMOS型電池帶上你的筆記型電腦去修理。 1]您的筆記型電腦充滿電了嗎?首先要做的事情是檢查您的筆記型電腦是否已經完全充電。如果電池耗盡,筆記型電腦將無法啟動

如何使用PHP和JS創建股票蠟燭圖股票蠟燭圖是股票市場中常見的技術分析圖形,透過繪製股票的開盤價、收盤價、最高價和最低價等數據,幫助投資者更直觀地了解股票的價格波動情形。本文將教你如何使用PHP和JS創建股票蠟燭圖,並附上具體的程式碼範例。一、準備工作在開始之前,我們需要準備以下環境:1.一台運行PHP的伺服器2.一個支援HTML5和Canvas的瀏覽器3

股票分析必備工具:學習PHP和JS繪製蠟燭圖的步驟,需要具體程式碼範例隨著網路和科技的快速發展,股票交易已成為許多投資者的重要途徑之一。而股票分析是投資人決策的重要一環,其中蠟燭圖被廣泛應用於技術分析。學習如何使用PHP和JS繪製蠟燭圖將為投資者提供更多直觀的信息,幫助他們更好地做出決策。蠟燭圖是一種以蠟燭形狀來展示股票價格的技術圖表。它展示了股票價格的

iPhone15系列發表後,有關蘋果新品iPhone16的外觀和配置相關爆料就沒斷過。 iPhone16長什麼樣? iPhone16有改進嗎?近日,有海外部落客展示了iPhone16系列機型的設計,整體設計和iPhone15系列基本上相同。從圖片中可以看到,iPhone16系列全系標配了一個全新的「拍攝」按鈕,讓使用者更方便地進行拍照。此外,其它設計細節暫時還不得而知。訊息顯示,這顆新增的按鈕將用於拍攝視頻,位於電源按鈕下方。以往的消息曾提到其可能是一顆電容式固態按鈕,但最近的說法顯示這應該還是一顆

IE瀏覽器點擊網頁按鈕沒反應怎麼辦?我們在點擊網頁按鈕沒有反應的話,可以在相容性視圖中進行設定!有小夥伴在使用IE瀏覽器的時候,發現點擊網頁中的按鈕,瀏覽器不會有任何的反應,這樣我們就無法使用該網頁的功能,我們可以怎麼樣設置,小編下面整理了IE瀏覽器點擊網頁按鈕沒有反應解決方法,不會的話跟著我一起往下看吧! IE瀏覽器點選網頁按鈕沒有反應解決方法1、開啟IE瀏覽器,點選操作列上【工具】按鈕,並點選【相容性檢視】設置,如圖所示。 2.在【相容性檢視】設定頁面中,點選右邊的【新增】按鈕,將該網站填入,

如何使用JS和百度地圖實現地圖點擊事件處理功能概述:在網路開發中,經常需要使用地圖功能來展示地理位置和地理資訊。而地圖上的點擊事件處理是地圖功能中常用且重要的一環。本文將介紹如何使用JS和百度地圖API來實現地圖的點擊事件處理功能,並給出具體的程式碼範例。步驟:匯入百度地圖的API檔案首先,要在HTML檔案中匯入百度地圖API的文件,可以透過以下程式碼實現:
