用jquery中插件dialog實(shí)現(xiàn)彈框效果實(shí)例代碼
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>彈框遮罩效果</title>
<style type="text/css">
#dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
#dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
</style>
<script type="text/javascript" language="javascript" src="jquery-1.7.1.min.js">
</script>
<script type="text/javascript" language="javascript" src="jquery-ui-1.8.18.custom.min.js">
</script>
<link rel="stylesheet" href="ui-lightness/jquery-ui-1.8.18.custom.css"/>
<script type="text/javascript" language="javascript">
$(function(){
$("#dialog").dialog({
autoOpen:false,
buttons:[{
text:"ok",
click:function(){
$("#dialog").dialog("close");
}
},
{
text:"cancal",
click:function(){
$("#dialog").dialog("close");
}
}
],
position:"top",//彈出位置
width:600, //窗口寬度
height:200,
drag:function(){
alert("你干拽我試試");
}
});
$("#dialog_link").click(function(){
$("#dialog").dialog("open");
});
})
</script>
</head>
<body>
<a href="#" id="dialog_link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>Open Dialog</a>
<!--對(duì)話(huà)框$("#dialog").dialog()他就是一個(gè)對(duì)話(huà)框,在頁(yè)面中就會(huì)隱藏-->
<div id="dialog" title="Hi" style="display:none">
hello
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>彈框遮罩效果</title>
<style type="text/css">
#dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
#dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
</style>
<script type="text/javascript" language="javascript" src="jquery-1.7.1.min.js">
</script>
<script type="text/javascript" language="javascript" src="jquery-ui-1.8.18.custom.min.js">
</script>
<link rel="stylesheet" href="ui-lightness/jquery-ui-1.8.18.custom.css"/>
<script type="text/javascript" language="javascript">
$(function(){
$("#dialog").dialog({
autoOpen:false,
buttons:[{
text:"ok",
click:function(){
$("#dialog").dialog("close");
}
},
{
text:"cancal",
click:function(){
$("#dialog").dialog("close");
}
}
],
position:"top",//彈出位置
width:600, //窗口寬度
height:200,
drag:function(){
alert("你干拽我試試");
}
});
$("#dialog_link").click(function(){
$("#dialog").dialog("open");
});
})
</script>
</head>
<body>
<a href="#" id="dialog_link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>Open Dialog</a>
<!--對(duì)話(huà)框$("#dialog").dialog()他就是一個(gè)對(duì)話(huà)框,在頁(yè)面中就會(huì)隱藏-->
<div id="dialog" title="Hi" style="display:none">
hello
</div>
</body>
</html>
相關(guān)文章
分享8款優(yōu)秀的 jQuery 加載動(dòng)畫(huà)和進(jìn)度條插件
加載動(dòng)畫(huà)和進(jìn)度條在網(wǎng)站和 Web 應(yīng)用中的使用非常流行。雖然網(wǎng)速越來(lái)越快,但是我們的網(wǎng)站越來(lái)越復(fù)雜,同時(shí)用戶(hù)對(duì)網(wǎng)站的使用體驗(yàn)的要求也越來(lái)越高2012-10-10
實(shí)例詳解jQuery Mockjax 插件模擬 Ajax 請(qǐng)求
這篇文章主要介紹了實(shí)例詳解jQuery Mockjax 插件模擬 Ajax 請(qǐng)求的相關(guān)資料,需要的朋友可以參考下2016-01-01
jQuery使用hide方法隱藏指定元素class樣式用法實(shí)例
這篇文章主要介紹了jQuery使用hide方法隱藏指定元素class樣式,實(shí)例分析了jQuery中hide隱藏class樣式的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-03-03
jquery拖動(dòng)插件(jquery.drag)使用介紹
可以使用鼠標(biāo)任意拖動(dòng)列表項(xiàng)改變默認(rèn)的位置,具體的實(shí)現(xiàn)如下(附演示),感興趣的朋友可以學(xué)習(xí)下2013-06-06
Jquery實(shí)現(xiàn)彈性滑塊滑動(dòng)選擇數(shù)值插件
有時(shí)我們?cè)陧?yè)面上需要選擇數(shù)值范圍,如購(gòu)物時(shí)選取價(jià)格區(qū)間,購(gòu)買(mǎi)主機(jī)時(shí)自主選取CPU,內(nèi)存大小配置等,使用直觀的滑塊條直接選取想要的數(shù)值大小即可,無(wú)需手動(dòng)輸入數(shù)值,操作簡(jiǎn)單又方便。2015-08-08
初學(xué)Jquery插件制作 在SageCRM的查詢(xún)屏幕隱藏部分行的功能
SageCRM的查詢(xún)條件屏幕的條件比較多,會(huì)占用界面,用戶(hù)希望首先顯示常用的查詢(xún)條件,然后點(diǎn)擊展開(kāi)的按鈕,可以看到一些不常用的查詢(xún)條件2011-12-12
使用jQuery實(shí)現(xiàn)簡(jiǎn)單穿梭框方式
這篇文章主要介紹了使用jQuery實(shí)現(xiàn)簡(jiǎn)單穿梭框方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-10-10

