js+css實現(xiàn)有立體感的按鈕式文字豎排菜單效果
本文實例講述了js+css實現(xiàn)有立體感的按鈕式文字豎排菜單效果。分享給大家供大家參考。具體如下:
這是一款較不錯的豎排菜單,有立體感效果的菜單,不要以為那些帶立體特效的菜單是按鈕啊,其實它就是用JavaScript代碼修飾出來的按鈕,鼠標放上的時候就會有明顯的立體文字效果,豎向排列的,也可以修改成橫向的。
運行效果截圖如下:

在線演示地址如下:
http://demo.jb51.net/js/2015/js-css-3d-nutton-v-menu-codes/
具體代碼如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>有立體感的按鈕式文字菜單,豎排</TITLE>
</HEAD>
<BODY>
<STYLE type=text/css>A:link {
TEXT-DECORATION: none
}
A:visited {
TEXT-DECORATION: none
}
A:active {
TEXT-DECORATION: none
}
A:hover {
TEXT-DECORATION: none
}
.up {
BORDER-RIGHT: #711200 1px solid; PADDING-RIGHT: 1px; BORDER-TOP: white 1px solid; PADDING-LEFT: 1px; FONT-SIZE: 9pt; PADDING-BOTTOM: 1px; BORDER-LEFT: white 1px solid; COLOR: #ff0000; PADDING-TOP: 1px; BORDER-BOTTOM: #711200 1px solid; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #eadfd0
}
</STYLE>
<SCRIPT language=JavaScript>
<!-- IE and NS6 Menu Button script kurt.grigg@virgin.net
if (!document.layers){
// Choose size and colours here!
Width=100;
Font='Verdana';
FontSize=9;
AFontColor='#000000';
BFontColor='red';
CFontColor='#ffffff';
down="#6699cc";
FontWeight='normal'; //normal or bold!
BackGround='#99ccff'; //Same as your body bgcolor!
BorderDepth=2;
BorderLight='#FFFFFF';
BorderShad='#000000';
//Nothing needs altering past here!!!!!!!!!!!!!!!!!!!!!!
function On(id){
with(id.style){
color=BFontColor;
borderTopColor=BorderLight;
borderLeftColor=BorderLight;
borderRightColor=BorderShad;
borderBottomColor=BorderShad;
}
}
function Off(id){
with(id.style){
color=AFontColor;
borderTopColor=BackGround;
borderLeftColor=BackGround;
borderRightColor=BackGround;
borderBottomColor=BackGround;
background=BackGround;
}
}
function Down(id){
with(id.style){
color=CFontColor;
borderTopColor=BorderShad;
borderLeftColor=BorderShad;
borderRightColor=BorderLight;
borderBottomColor=BorderLight;
background=down;
}
}
function Link(Url,Txt,target){
document.write("<a href='"+Url+"' target='"+target+"'>"
+"<div style='position:relative;"
+"width:"+Width+"px;height:"+FontSize+"px;"
+"border-width:"+BorderDepth+"px;"
+"border-color:"+BackGround+";"
+"border-style:solid;"
+"padding:"+FontSize/4.5+"pt;"
+"background:"+BackGround+";"
+"font-family:"+Font+";"
+"font-size:"+FontSize+"pt;"
+"line-height:"+FontSize*1.2+"pt;"
+"font-weight:"+FontWeight+";"
+"text-align:left;"
+"color:"+AFontColor+";"
+"margin-top:2px;"
+"cursor:hand'"
+"onMouseOver='javascript:On(this)'"
+"onMouseOut='javascript:Off(this)'"
+"onMouseDown='javascript:Down(this)'>"
+Txt+"</div></a>");
}
}
function Temp(){
alert("TEST");
}
//-->
</SCRIPT>
<!-- End Menu Buttons Part:1 -->
<!-- Menu Buttons Part:2 Paste in Body where needed -->
<SCRIPT language=JavaScript>
<!--
if (!document.layers){
if (document.getElementById&&!document.all){
document.write("<div style='position:relative'>"
+"<table border='0' cellpadding='0' cellspacing='0'>"
+"<tr><td valign='top'>");
}
Link('http://www.baidu.com','百度一下','_blank');
Link('http://www.yahoo.com','Yahoo','_blank');
Link('http://www.google.com','Google','_blank');
Link('http://www.hongen.com','洪恩在線','_blank');
Link('http://www.163.com','網(wǎng)易','main');
if (document.getElementById&&!document.all){
document.write("</td></tr></table></div>");
}
}
//-->
</SCRIPT>
</BODY>
</HTML>
希望本文所述對大家的javascript設計有所幫助。
- extjs 的權限問題 要求控制的對象是 菜單,按鈕,URL
- jQuery EasyUI API 中文文檔 - MenuButton菜單按鈕使用介紹
- 單擊按鈕顯示隱藏子菜單經(jīng)典案例
- js使用DOM設置單選按鈕、復選框及下拉菜單的方法
- jQuery EasyUI 菜單與按鈕之創(chuàng)建簡單的菜單和鏈接按鈕
- 輕松學習jQuery插件EasyUI EasyUI創(chuàng)建菜單與按鈕
- 基于Android實現(xiàn)點擊某個按鈕讓菜單選項從按鈕周圍指定位置彈出
- javascript+css3 實現(xiàn)動態(tài)按鈕菜單特效
- Bootstrap入門書籍之(四)菜單、按鈕及導航
- 第七章之菜單按鈕圖標組件
相關文章
JS實現(xiàn)獲取word文檔內(nèi)容并輸出顯示到html頁面示例
這篇文章主要介紹了JS實現(xiàn)獲取word文檔內(nèi)容并輸出顯示到html頁面,結(jié)合實例形式分析了JavaScript使用ActiveXObject組建操作word文件的相關實現(xiàn)技巧,需要的朋友可以參考下2018-06-06
BootStrap的select2既可以查詢又可以輸入的實現(xiàn)代碼
這篇文章主要介紹了bootstrap的select2既可以查詢又可以輸入的實現(xiàn)代碼,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2017-02-02
JS響應鼠標點擊實現(xiàn)兩個滑塊區(qū)間拖動效果
這篇文章主要介紹了JS實現(xiàn)的兩個滑塊區(qū)間拖動效果代碼,涉及JavaScript響應鼠標事件針對頁面元素的動態(tài)操作技巧,需要的朋友可以參考下2015-10-10
JavaScript中常見的字符串操作函數(shù)及用法匯總
這篇文章主要介紹了JavaScript中常見的字符串操作函數(shù)及用法,實例匯總了javascript常見的字符串轉(zhuǎn)換、分割、查詢、替換等技巧,非常具有實用價值,需要的朋友可以參考下2015-05-05

