欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JQuery的Alert消息框插件使用介紹

 更新時(shí)間:2010年10月09日 20:24:42   作者:  
沒有厭倦了原來那alert那個(gè)風(fēng)格,總是一個(gè)感嘆號(hào)。有時(shí)使得UE不好,今天我們介紹使用Jquery Alert插件 ,使用它可以用來替換JScript中的alert,confirm,prompt。
下載JS文件引用到page中,如下代碼:
復(fù)制代碼 代碼如下:

<!-- Dependencies -->
<script src="/path/to/jquery.js" type="text/javascript"></script>
<script src="/path/to/jquery.ui.draggable.js" type="text/javascript"></script>
<!-- Core files -->
<script src="/path/to/jquery.alerts.js" type="text/javascript"></script>
<link href="/path/to/jquery.alerts.css" rel="stylesheet" type="text/css" media="screen" />

注意其中draggable是用來實(shí)現(xiàn)拖拉的,如不需要這個(gè)功能不就不用引用。在目前最近的Jquery1.42下應(yīng)用引用:
復(fù)制代碼 代碼如下:

<script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.8.5.custom.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.alerts.js" type="text/javascript"></script>
<link href="Content/Style/jquery.alerts.css" rel="stylesheet" type="text/css" />

主要方法有:
jAlert(message, [title, callback]) 創(chuàng)建一個(gè)alert
jConfirm(message, [title, callback]) 創(chuàng)建一個(gè)確認(rèn)allert,支持callback
jPrompt(message, [value, title, callback]) 創(chuàng)建一個(gè)提示框讓用戶輸入值,支持callback如果你有提供
可以參下面的示例Code:
復(fù)制代碼 代碼如下:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Defualt.aspx.cs" Inherits="WebApplication6.Defualt" %>
<!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 id="Head1" runat="server">
<title></title>
<script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.8.5.custom.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.alerts.js" type="text/javascript"></script>
<link href="Content/Style/jquery.alerts.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function () {
$("#btnAlert").click(function ()
{ jAlert('Pushed the alert button', 'Alert Dialog'); });
$("#btnPrompt").click(function () {
jPrompt('Type some value:', '', 'Prompt Dialog', function (typedValue) {
if (typedValue) {
jAlert('You typed the following ' + typedValue);
}
});
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" value="Alert Me" id="btnAlert" />
<input type="button" value="Prompt Me" id="btnPrompt" />
</div>
</form>
</body>
</html>

最后alert效果圖:
 
打包下載地址 http://www.dbjr.com.cn/jiaoben/32367.html

相關(guān)文章

最新評論