詳解cookie驗證的php應(yīng)用的一種SSO解決辦法
723
2023-12-08
本文實例講述了jQuery簡單實現(xiàn)中間浮窗效果。分享給大家供大家參考,具體如下:
basic.css:
/* * -- 樣式說明 -- * 最大優(yōu)先實現(xiàn)法,全局能實現(xiàn)不用區(qū)域,區(qū)域能實現(xiàn)不用模板,模板能實現(xiàn)不用界面,界面能實現(xiàn)不用標(biāo)簽 * g - 全局 * t - 區(qū)域 * m - 模板 * ui - 界面 * lb - 標(biāo)簽 * j - 腳本 只使用在有JS操作的樣式 */ /*公共樣式*/ html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, menu, nav, section, time, mark, audio, video, details, summary{ margin:0; padding:0;} body{ font-family:Helvetica,Tahoma,Arial,sans-serif; color:#333; font-size:16px; background-color:#fff;} input, select, textarea{ font-family:Helvetica,Tahoma,Arial,sans-serif; background:#fff; margin:0; padding:0; outline:none;} textarea{ resize:none;} img{ border:none;} i, em{ font-style:normal;} ul li{ list-style-type:none;} a{ color:#06f; text-decoration:none;} a:hover{ color:#06f; text-decoration:underline;} /*全局樣式*/ .g-fl{ float:left;} .g-fr{ float:right;} .g-c{ clear:both;}
index.html:
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no"> <title>中間浮窗</title> <link rel="stylesheet"> <script src="http://www.gimoo.net/t/1812/js/jquery-1.10.1.min.js"></script> </head> <body> <div style="height:10000px;"></div> <style type="text/css"> /*建議先隱藏浮窗的樣式 display:none*/ .j-fixcenter{ height:120px; width:219px; background:#f60; display:none; position:fixed; } </style> <div id="fixCenter" class="j-fixcenter"> <img src="http://www.gimoo.net/t/1812/img/fixCenter.jpg" width="219" height="120" usemap="#fixCenterMap"> <繪制地圖,把圖片哪個位置要點擊的繪制出來--> <map name="fixCenterMap" id="fixCenterMap"> <area shape="rect" coords="175,0,219,30" href="javascript:void();" id="closeFixCenter" /> <area shape="rect" coords="0,30,219,94" /> <area shape="rect" coords="0,94,219,120" /> </map> </div> <script type="text/javascript"> $(function(){ //調(diào)用浮窗方法 fixCenter(); }); //當(dāng)調(diào)整瀏覽器窗口的大小時,發(fā)生 resize 事件 $(window).resize(function(){ //重置浮窗定位 fixCenterGetPosition(); }); function fixCenter(){ //獲取浮窗定位 fixCenterGetPosition(); //獲取在浮窗的元素ID var fid = $("#fixCenter"); //漸變顯示元素 fid.fadeIn(600); //關(guān)閉按鈕的點擊事件 $("#closeFixCenter").click(function(){ //漸變隱藏元素,三秒后重新顯示 fid.fadeOut(600).delay(3000).fadeIn(600); }); } function fixCenterGetPosition(){ var fid = $("#fixCenter"); //獲取當(dāng)前窗口的高度 var h = $(window).height(); //獲取當(dāng)前窗口的寬度 var w = $(window).width(); //計算要定位左側(cè)距離 var left = (w/2) - parseInt(fid.css("width")) / 2; //計算要定位上側(cè)距離 var top = (h/2) - parseInt(fid.css("height")) / 2; //設(shè)置定位距離的樣式 fid.css({"left":(left) + "px", "top": (top) + "px" }); } </script> </body> </html>
效果圖:
更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery擴(kuò)展技巧總結(jié)》、《jQuery常用插件及用法總結(jié)》、《jQuery拖拽特效與技巧總結(jié)》、《jQuery表格(table)操作技巧匯總》、《jquery中Ajax用法總結(jié)》、《jQuery常見經(jīng)典特效匯總》、《jQuery動畫與特效用法總結(jié)》及《jquery選擇器用法總結(jié)》
希望本文所述對大家jQuery程序設(shè)計有所幫助。
#免責(zé)聲明#
本站[綠夏技術(shù)導(dǎo)航]提供的一切軟件、教程和內(nèi)容信息僅限用于學(xué)習(xí)和研究目的;不得將上述內(nèi)容用于商業(yè)或者非法用途,否則,一切后果請用戶自負(fù)。本站信息來自網(wǎng)絡(luò)收集整理,版權(quán)爭議與本站無關(guān)。您必須在下載后的24個小時之內(nèi),從您的電腦或手機中徹底刪除上述內(nèi)容。如果您喜歡該程序或內(nèi)容,請支持正版,購買注冊,得到更好的正版服務(wù)。我們非常重視版權(quán)問題,如有侵權(quán)請郵件[admin@lxwl520.com]與我們聯(lián)系進(jìn)行刪除處理。敬請諒解!