我正在寻找一些示例代码/控件,它通过 ASP.NET 中的 jQuery 让我感觉像 gmail 的消息框。
Mahesh
问问题
21203 次
2 回答
13
于 2009-03-05T09:06:46.843 回答
5
您可以使用插件,但您也可以在页面顶部放置一个固定的 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>
您必须弄清楚如何隐藏它(操作完成后的回调等),设置样式等等。这只是一个例子。
于 2009-03-05T09:48:52.403 回答