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 id="">1</h1></div> <div style="display:none" id=w2><h1 id="">2</h1></div> <div style="display:none" id=w3><h1 id="">3</h1></div> <div style="display:none" id=w4><h1 id="">4</h1></div> <div style="display:none" id=w5><h1 id="">5</h1></div> <div style="display:none" id=w6><h1 id="">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和百度地图实现地图点击事件处理功能概述:在Web开发中,经常需要使用地图功能来展示地理位置和地理信息。而地图上的点击事件处理是地图功能中常用且重要的一部分。本文将介绍如何使用JS和百度地图API来实现地图的点击事件处理功能,并给出具体的代码示例。步骤:导入百度地图的API文件首先,要在HTML文件中导入百度地图API的文件,可以通过以下代码实现:
