JavaScript實作點擊文字切換登入視窗的方法_javascript技巧
本文實例講述了JavaScript實作點擊文字切換登入視窗的方法。分享給大家供大家參考。具體分析如下:
這是一款動畫切換層窗口的特效,點擊不同的登入使用者會切換到不同的登入窗口,窗口內的內容可以是不一樣的,是比較實用的一款程式碼。
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>JAVASCRIPT适时切换登录窗口</title> <style> TD{ font-size: 9pt; color: #66DDDD} .out{ font-size: 9pt; color: #66DDDD;border-width:1px; border-style:solid;border-color:0090c0 0070b0 0070b0 0090c0; cursor:hand; background:0080c0; text-align: center } .out2 { text-align: center} .in,.out2{ font-size: 9pt; color: #66DDDD;border-width:1px; border-style:solid;border-color:0070b0 0090c0 0090c0 0070b0; background:0078b8;cursor:default } </style> </head> <body> <script> var temp_num = null; var now_num = null; var the_top = 130; var the_bottom = 150 var no_can_do = false; function Show_menu(u_num,d_num) { event.srcElement.className = "out2"; if(no_can_do) { return; } now_num = d_num; if(temp_num) { if(document.getElementById("menu_"+temp_num).doing) { clearInterval(document.getElementById("menu_"+temp_num).doing); } } else { temp_num = u_num; } document.getElementById("menu_"+temp_num).doing = setInterval("set_menu()",10); } function set_menu() { no_can_do = true; document.getElementById("form_"+temp_num).style.display = "none"; var if_move = document.getElementById("div_"+temp_num).style.pixelHeight - 6; if(if_move>1) { document.getElementById("div_"+temp_num).style.pixelHeight = if_move; } else { document.getElementById("div_"+temp_num).style.pixelHeight = 1; var if_stop = document.getElementById("menu_"+temp_num).style.pixelTop - 1; if(if_stop>the_top) { document.getElementById("menu_"+temp_num).style.pixelTop = if_stop; document.getElementById("menu_"+now_num).style.pixelTop += 1; } else { document.getElementById("menu_"+temp_num).style.pixelTop = the_top; document.getElementById("menu_"+now_num).style.pixelTop = the_bottom; var if_end = document.getElementById("div_"+now_num).style.pixelHeight + 6; if(if_end < 182) { document.getElementById("div_"+now_num).style.pixelHeight = if_end } else { document.getElementById("div_"+now_num).style.pixelHeight = 182; clearInterval(document.getElementById("menu_"+temp_num).doing); document.getElementById("menu_"+temp_num).doing = false; document.getElementById("form_"+now_num).style.display = "block"; temp_num = null; no_can_do = false; } } } } function returnIT() { event.srcElement.className = "out"; } </script> <div id="menu_0" style="position: absolute; top: 127; left: 176; width: 340; height: 201"> <table border="0" width="100%" style="background-color: #0080C0" cellspacing="0" cellpadding="0" height="19"> <tr> <td width="277" class="out" height="19" style="cursor: default"> </td> <td width="58" class="out" height="19" onmousedown="Show_menu(1,0)" onmouseup="returnIT()">管理员</td> </tr> </table> <div id="div_0" style="position: relative; width: 339; height: 1; overflow: hidden"> <table border="0" width="100%" style="background-color: #0080C0" cellspacing="0" cellpadding="0" height="182"> <tr> <td width="100%" height="182"> <form id="form_0" style="position: relative; left:70; top:10;font-family: Arial; display: none" action="javascript:;" method="post" align="center"> 超级管理员: <br> <br> 帐号: <input class="in" style="WIDTH: 100px" size="20"> mail.cn<br> 密码: <input class="in" type="password" size="20"><br> <br> <input class="out" onfocus="this.blur()" type="button" value="登录"> </form> </td> </tr> </table> </div> </div> <div id="menu_1" style="position: absolute; top: 146; left: 176; width: 339; height: 219"> <table border="0" width="100%" style="background-color: #0080C0" cellspacing="0" cellpadding="0" height="19"> <tr> <td width="277" class="out" height="19" style="cursor: default"> </td> <td width="58" class="out" height="19" onmousedown="Show_menu(0,1)" onmouseup="returnIT()">一般用户</td> </tr> </table> <div id="div_1" style="position: relative; width: 339; height: 182; overflow: hidden"> <table border="0" width="100%" style="background-color: #0080C0" cellspacing="0" cellpadding="0" height="100%"> <tr> <td width="100%" height="182"> <form id="form_1" style="position: relative; left:70; top:10;font-family: Arial; display: block" action="javascript:;" method="post" align="center"> 一般用户: <br> <br> 帐号: <input class="in" style="WIDTH: 100px" size="20"> mail.cn<br> 口令: <input class="in" type="password" size="20"><br> <br> <input class="out" onfocus="this.blur()" type="button" value="登录"> </form> </td> </tr> </table> </div> </div> </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)

如何使用WebSocket和JavaScript實現線上語音辨識系統引言:隨著科技的不斷發展,語音辨識技術已成為了人工智慧領域的重要組成部分。而基於WebSocket和JavaScript實現的線上語音辨識系統,具備了低延遲、即時性和跨平台的特點,成為了廣泛應用的解決方案。本文將介紹如何使用WebSocket和JavaScript來實現線上語音辨識系

小米14Ultra是今年小米中非常火熱的機型之一,小米14Ultra不僅升級了處理器以及各種配置,而且還為用戶們帶來了很多新的功能應用,從小米14Ultra銷售就可以看出來手機的火爆程度,不過有一些常用的功能可能你還沒了解。那麼小米14Ultra如何切換4g和5g呢?下面小編就來為大家介紹一下具體的內容吧!小米14Ultra怎麼換4g和5g? 1.打開手機的設定選單。 2、設定選單中尋找並選擇「網路」、「行動網路」的選項。 3.在行動網路設定中,會看到「首選網路類型」選項。 4、點選或選擇該選項,會看到

Win11家庭版怎麼轉換成Win11專業版?在Win11系統中,分為了家庭版、專業版、企業版等,而大部分Win11筆電都是預先安裝Win11家用版系統。而今天小編就帶給大家win11家庭版切換專業版操作步驟!1、先在win11桌面此電腦上右鍵屬性。 2、點選更改產品金鑰或升級windows。 3、然後進入後點選更改產品金鑰。 4.再輸入啟動金鑰:8G7XN-V7YWC-W8RPC-V73KB-YWRDB,選擇下一步。 5.接著就會提示成功,這樣就可以將win11家用版升級win11專業版了。

WebSocket與JavaScript:實現即時監控系統的關鍵技術引言:隨著互聯網技術的快速發展,即時監控系統在各個領域中得到了廣泛的應用。而實現即時監控的關鍵技術之一就是WebSocket與JavaScript的結合使用。本文將介紹WebSocket與JavaScript在即時監控系統中的應用,並給出程式碼範例,詳細解釋其實作原理。一、WebSocket技

很多朋友剛接觸win系統的時候可能用不習慣,電腦裡存雙系統,這時候其實是可以雙系統切換的,下面就一起來看看兩個系統切換的詳細步驟吧。 win10系統如何兩個系統切換方法一、快捷鍵切換1、按下“win”+“R”鍵開啟運行2、在運行框中輸入“msconfig”點擊“確定”3、在打開的“系統配置”介面中選擇自己需要的系統點擊“設為預設值”,完成後“重新啟動”即可完成切換方法二、開機時選擇切換1、擁有雙系統時開機會出現一個選擇操作介面,可以使用鍵盤“上下”鍵進行選擇系統

蘋果雙系統開機怎麼切換蘋果電腦作為一款功能強大的設備,除了搭載自家的macOS作業系統外,也可以選擇安裝其他作業系統,例如Windows,從而實現雙系統的切換。那麼在開機時,我們要如何切換這兩個系統呢?本文就來為大家介紹一下在蘋果電腦上如何實現雙系統的切換。首先,在安裝雙系統之前,我們需要確認自己的蘋果電腦是否支援雙系統切換。一般來說,蘋果電腦都是基於

在excel軟體的應用程式裡,我們已經習慣使用快捷鍵,讓有些操作變得更簡單和快捷,excel的多個表格之間有時候會有相關的數據,我們在查看時,要不停的切換工作簿,如果有更快捷的切換方法,就會省下很多切換浪費的時間,對工作效率的提高有很大的幫助,什麼辦法可以完成快速的切換呢,針對這個問題,小編今天要講的內容是:excel切換工作簿快速鍵的使用方法。 1.首先在開啟的excel表格的下方可以看到有多個工作簿,需要快速切換不同的工作簿,如下圖所示。 2、然後按下鍵盤上的Ctrl鍵不動,如果需要向右選擇工作

JavaScript和WebSocket:打造高效的即時天氣預報系統引言:如今,天氣預報的準確性對於日常生活以及決策制定具有重要意義。隨著技術的發展,我們可以透過即時獲取天氣數據來提供更準確可靠的天氣預報。在本文中,我們將學習如何使用JavaScript和WebSocket技術,來建立一個高效的即時天氣預報系統。本文將透過具體的程式碼範例來展示實現的過程。 We
