Gmail 类似警报框(用于信息或错误显示)通过 ASP.NET 中的 jQuery
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/613934/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Gmail like alert box (for infomation or error display) throught jQuery in ASP.NET
提问by Mahesh
I am looking for some sample code/control which gives me the feel of gmail like message box through jQuery in ASP.NET.
我正在寻找一些示例代码/控件,它让我通过 ASP.NET 中的 jQuery 感觉像 gmail 一样的消息框。
回答by Davy Landman
I think what your looking for is jQuery BlockUI.
我想你要找的是jQuery BlockUI。
Have a look at the demo's.
看看演示的.
Using css you can match the styles of gmail.
使用 css 可以匹配 gmail 的样式。
回答by Pawel Krakowiak
You can use plugins, but you can also have a fixed DIV sitting at the top of your page and fade it in/out. Let's see an example:
您可以使用插件,但您也可以在页面顶部放置一个固定的 DIV 并使其淡入/淡出。让我们看一个例子:
<!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>
<title>jQuery</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('input').click(function() {
$('#notification').fadeIn('slow');
});
});
</script>
</head>
<body style="height: 1000px;">
<div id="notification" style="position: fixed; top: 0px; margin-left: 50%; background-color: yellow; font-weight: bold; display: none;">Sending...</div>
<input type="button" value="Gmail notification!" />
</body>
</html>
You have to work out how to hide it (a callback after the operation completes, etc.), style it and so on. That's just an example.
您必须弄清楚如何隐藏它(操作完成后的回调等)、设置样式等等。那只是一个例子。