中文字幕免费精品_亚洲视频自拍_亚洲综合国产激情另类一区_色综合咪咪久久

Js Jquery創(chuàng)建一個彈出層可加載一個頁面
來源:易賢網(wǎng) 閱讀:5080 次 日期:2014-05-09 14:56:28
溫馨提示:易賢網(wǎng)小編為您整理了“Js Jquery創(chuàng)建一個彈出層可加載一個頁面”,方便廣大網(wǎng)友查閱!

Js Jquery創(chuàng)建一個彈出層,當(dāng)加載一個頁面進(jìn)彈出層時出現(xiàn)亂碼,示例代碼如下,大家可以參考參考

代碼如下:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title> New Document </title>

<script type="text/javascript" src="../jquery-1.7.2.js"></script>

<script type="text/javascript">

//創(chuàng)建一個彈出層,title 標(biāo)題,width 寬度,height 高度,content 內(nèi)容,url 如果url不為空時則覆蓋content加載url頁面中的內(nèi)容

function CreatePopLayerDiv(title,width,height,content,url){

var titles = title || "標(biāo)題";

var Iheight=$(window).height();

var Iwidth =$(window).width();

var heights = height || 300;

var widths = width || 500;

var Oheight= (Iheight -heights) / 2;

var Owidth = (Iwidth - widths) /2;

var contents = content || "內(nèi)容";

var div = "<div id='InDiv' style='width:"+Iwidth+"px;height:"+Iheight+"px;background-color:#888;position:absolute;z-index:10000;top:0;left:0;opacity:0.7;'><div id='offDiv' style='width:"+widths+"px;height:"+heights+"px;left:"+Owidth+"px;top:"+Oheight+"px;background-color:white;position:absolute;z-index:10001;'><h4 id='HTitle' style='margin:0px;padding:3px;background:#336699;opacity:0.9;border:1px solid ##336699;height:20px;line-height:20px;font:12px Verdana, Geneva, Arial, Helvetica, sans-serif;color:white;cursor:pointer;text-align:left;'>"+titles+"<a id='AClose' onclick='btnCloses()' style='float:right;'>關(guān)閉</a></h4><div id='Content'>"+contents+"</div></div></div>";

$(document.body).append(div);

if(url != ""){

$("#Content").load(url);

}

}

//移除彈出層

function RemoveDiv(){

$("#AClose").remove();

$("#HTitle").remove();

$("#offDiv").remove();

$("#InDiv").remove();

}

$(function(){

$("#btnTCC").click(function(){

CreatePopLayerDiv("閃耀的瞬間",600,400,"彈出層","table偶數(shù)行變色.html");

});

})

function btnCloses(){

RemoveDiv();

}

</script>

</head>

<body>

<input type="button" id="btnTCC" value="彈出層" />

</body>

</html>

更多信息請查看IT技術(shù)專欄

更多信息請查看網(wǎng)絡(luò)編程
易賢網(wǎng)手機(jī)網(wǎng)站地址:Js Jquery創(chuàng)建一個彈出層可加載一個頁面
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

2026國考·省考課程試聽報名

  • 報班類型
  • 姓名
  • 手機(jī)號
  • 驗證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機(jī)站點 | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
云南網(wǎng)警備案專用圖標(biāo)
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
云南網(wǎng)警報警專用圖標(biāo)
主站蜘蛛池模板: 罗定市| 文安县| 闸北区| 彭阳县| 托克托县| 晋州市| 南陵县| 和田市| 郁南县| 台安县| 安图县| 勐海县| 平塘县| 团风县| 富蕴县| 邯郸市| 宁安市| 疏勒县| 安溪县| 临夏县| 德令哈市| 禹城市| 靖远县| 晋江市| 桐梓县| 三亚市| 班戈县| 潼南县| 阳朔县| 六盘水市| 涿鹿县| 长丰县| 巍山| 丰原市| 宁明县| 高雄市| 崇州市| 温宿县| 海原县| 沂南县| 浦县|