純js實作仿QQ郵箱彈出確認框_javascript技巧
程式碼非常簡單,這裡就不多廢話了。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML> <HEAD> <TITLE>QQ邮箱的弹出层</TITLE> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style> body { background: none repeat scroll 0 0 #FFFFFF; font-family: "lucida Grande",Verdana; font-size: 12px; } select, body, textarea { font-size: 12px; } .tipbg { margin: 0; padding: 0; background-color: transparent; } .qmpanel_shadow { border-radius: 3px 3px 3px 3px; box-shadow: 0 2px 7px rgba(0, 0, 0, 0.35); } .bd_upload { border: 1px solid #628D0B; } .bd_upload { border: 1px solid #628D0B; } .fdbody { border-left: 8px solid #FFFFFF; border-right: 1px solid #87A34D; } .fdbody, .tipstitle { background: none repeat scroll 0 0 #9BBB59; } .editor_dialog_title { color: white; font: bold 12px "lucida Grande",Verdana; padding: 9px 0 7px 10px; text-align: left; } .editor_dialog_content { background: none repeat scroll 0 0 #FFFFFF; filter: none; margin: 0; padding: 0; text-align: center; } .mailinfo { border-bottom: 2px solid #FFFFFF; } .mailinfo { background: none repeat scroll 0 0 #FFFFFF; } .cnfx_content { padding: 10px 0 5px 10px; text-align: left; } .cnfx_status { float: left; padding: 0 0 0 10px; } .cnfx_btn { padding: 0 10px 10px 0; text-align: right; } .b_size { font-size: 14px; } .editor_close { background: none repeat scroll 0 0 #DC4835; } /** when mouseover,add editor_close_mover*/ .editor_close, .editor_close_mover { border: 1px solid #A7190F; cursor: pointer; float: right; margin: 7px 7px 0 0; } .editor_close img, .editor_close_mover img, .editor_min img, .editor_min_mover img { display: block; } img { border: medium none; } .wd2 { margin: 1px 1px 0 0; width: 64px; } .btn, button, .qm_btn { padding-left: 0; padding-right: 0; } input, textarea, a { outline: medium none; } .editor_mask { background: none repeat scroll 0 0 #FFFFFF; height: 100%; left: 0; opacity: 0.5; position: absolute; top: 0; width: 100%; } </style> <script> ///////// 拖拽工具类 //////// var DragUtil = (function(){ var doc = document; var moveX = 0; var moveY = 0; var moveTop = 0; var moveLeft = 0; var moveable = false; return { /** * 注册拖拽 * 需要传入整个窗体id和标题部分的id */ regist:function(winId,titleId) { // 页面头部要加上: // <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> // 不然会有问题的 var width = doc.documentElement.clientWidth; var height = doc.documentElement.clientHeight; var title = doc.getElementById(titleId); var win = doc.getElementById(winId); title.onmousedown = function() { var evt = DragUtil._getEvent(); moveable = true; moveX = evt.clientX; moveY = evt.clientY; moveTop = parseInt(win.style.top); moveLeft = parseInt(win.style.left); doc.onmousemove = function() { if (moveable) { var evt = DragUtil._getEvent(); var x = moveLeft + evt.clientX - moveX; var y = moveTop + evt.clientY - moveY; var w = parseInt(win.style.width); var h = parseInt(win.style.height); if ( x > 0 &&( x + w < width) && y > 0 && (y + h < height) ) { win.style.left = x + "px"; win.style.top = y + "px"; } } }; doc.onmouseup = function () { if (moveable) { //doc.onmousemove = docMouseMoveEvent; //doc.onmouseup = docMouseUpEvent; moveable = false; moveX = 0; moveY = 0; moveTop = 0; moveLeft = 0; } }; } } /** * 获取事件 */ ,_getEvent:function(){ return window.event || arguments.callee.caller.arguments[0]; } } })() /////////////////////// function init(){ DragUtil.regist("WindowId","titleId") DragUtil.regist("WindowId2","titleId2") } </script> </HEAD> <BODY onload="init()"> <span id="qmdialog_container"><div style="z-index: 1120; position: absolute; width: 447px; height: 163px; opacity: 1; left: 514px; top: 124px; margin-top: 0pt;" class="" id="WindowId" qmanimation_play="|undefined"> <div class="tipbg"> <div style="background: #DDD;" class="opashowOuter qmpanel_shadow" id="QMconfirm___opashow_"> <table cellspacing="0" cellpadding="0" style="width: 447px; height: 163px;background: white;" class="bd_upload"> <tbody> <tr> <td style="height: 28px; border: none; background-image: none; cursor: move; overflow: hidden;" class="editor_dialog_titlebar fdbody" id="QMconfirm___title_td_"><div id="QMconfirm___title_div_" style="cursor: default; float: right; width: 40px; border: none; background-image: none;" class="fdbody"> <div onmouseout="this.className='editor_close';" onmouseover="this.className='editor_close_mover';" class="editor_close" id="QMconfirm___closebtn2_"> <img height="12" width="12" ondragstart="return false;" src="http://www.jb51.net/jscss/demoimg/201109/ico_closetip.gif"> </div> </div> <div id="titleId" class="editor_dialog_title">删除确认</div> </td> </tr> <tr> <td valign="top" style="height: 131px; border: medium none; visibility: visible;" class="editor_dialog_content " id="QMconfirm___content_"><div class="mailinfo" style="border: none; height: 100%; display: inline;"> <div class=""> <div class="cnfx_content"> <img align="absmiddle" style="float: left; margin: 5px 10px 0; display: block;" src="http://www.jb51.net/jscss/demoimg/201109/ico_question.gif"> <table style="width: 350px; height: 80px;"> <tbody> <tr> <td style="vertical-align: top;"><div class="b_size" style="padding-top: 10px; word-break: break-all; line-height: 150%;"> <div>彻底删除后邮件将无法恢复,您确定要删除吗?</div> </div></td></tr></tbody> </table> </div> <div style="display: none;" class="cnfx_status"> <input type="checkbox" id="QMconfirm__recordstatus"><label for="QMconfirm__recordstatus"></label> </div> <div class="cnfx_btn"> <input type="button" value="确定" id="QMconfirm__confirm" class="wd2 btn"><input type="button" value="取消" style="display: ;" id="QMconfirm__cancel" class="wd2 btn"><input type="button" value="" style="display: none;" id="QMconfirm__never" class="wd2 btn"> </div> </div> </div> </td> </tr> </tbody> </table> </div> </div> </div> </span> <span id="qmdialog_container"><div style="z-index: 1120; position: absolute; width: 447px; height: 163px; opacity: 1; left: 514px; top: 324px; margin-top: 0pt;" class="" id="WindowId2" qmanimation_play="|undefined"> <div class="tipbg"> <div style="background: #DDD;" class="opashowOuter qmpanel_shadow" id="QMconfirm___opashow_"> <table cellspacing="0" cellpadding="0" style="width: 447px; height: 163px;background: white;" class="bd_upload"> <tbody> <tr> <td style="height: 28px; border: none; background-image: none; cursor: move; overflow: hidden;" class="editor_dialog_titlebar fdbody" id="QMconfirm___title_td_"><div id="QMconfirm___title_div_" style="cursor: default; float: right; width: 40px; border: none; background-image:none;" class="fdbody"> <div onmouseout="this.className='editor_close';" onmouseover="this.className='editor_close_mover';" class="editor_close" id="QMconfirm___closebtn2_"> <img height="12" width="12" ondragstart="return false;" src="http://www.jb51.net/jscss/demoimg/201109/ico_closetip.gif"> </div> </div> <div id="titleId2" class="editor_dialog_title">删除确认</div> </td> </tr> <tr> <td valign="top" style="height: 131px; border: medium none; visibility: visible;" class="editor_dialog_content " id="QMconfirm___content_"><div class="mailinfo" style="border: none; height: 100%; display: inline;"> <div class=""> <div class="cnfx_content"> <img align="absmiddle" style="float: left; margin: 5px 10px 0; display:none;" src="http://www.jb51.net/jscss/demoimg/201109/ico_question.gif"> <table style="width: 350px; height: 80px;"> <tbody> <tr> <td style="vertical-align: top;"><div class="b_size" style="padding-top: 10px; word-break: break-all; line-height: 150%;"> <div>彻底删除 后邮件将无法恢复,您确定要删除吗?</div> </div> </td> </tr> </tbody> </table> </div> <div style="display: none;" class="cnfx_status"> <input type="checkbox" id="QMconfirm__recordstatus"><label for="QMconfirm__recordstatus"></label> </div> <div class="cnfx_btn"> <input type="button" value="确定" id="QMconfirm__confirm" class="wd2 btn"><input type="button" value="取消" style="display: ;" id="QMconfirm__cancel" class="wd2btn"><input type="button" value="" style="display: none;" id="QMconfirm__never" class="wd2 btn"> </div> </div> </div> </td> </tr> </tbody> </table> </div> </div> </div> </span> </BODY> </HTML>
以上所述就是本文的全部內容了,希望大家能夠喜歡。

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

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

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

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

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

如何使用JS和百度地圖實現地圖熱力圖功能簡介:隨著互聯網和行動裝置的快速發展,地圖成為了普遍的應用場景。而熱力圖作為一種視覺化的展示方式,能夠幫助我們更直觀地了解數據的分佈。本文將介紹如何使用JS和百度地圖API來實現地圖熱力圖的功能,並提供具體的程式碼範例。準備工作:在開始之前,你需要準備以下事項:一個百度開發者帳號,並建立一個應用,取得到對應的AP

隨著網路金融的快速發展,股票投資已經成為了越來越多人的選擇。而在股票交易中,蠟燭圖是常用的技術分析方法,它能夠顯示股票價格的變動趨勢,幫助投資人做出更精準的決策。本文將透過介紹PHP和JS的開發技巧,帶領讀者了解如何繪製股票蠟燭圖,並提供具體的程式碼範例。一、了解股票蠟燭圖在介紹如何繪製股票蠟燭圖之前,我們首先需要先了解什麼是蠟燭圖。蠟燭圖是由日本人

js和vue的關係:1、JS作為Web開發基石;2、Vue.js作為前端框架的崛起;3、JS與Vue的互補關係;4、JS與Vue的實踐應用。
