2 回答

TA貢獻1860條經驗 獲得超8個贊
有很多種方式可以實現。
1、$(iframeId).toggle(2000); //2秒
2、$(iframeId).fadeOut(2000);
$(iframeId).fadeIn(2000);
3、 $(iframeId).slideDown(2000);
$(iframeId).slideUp(2000)
4、 $(iframeId).slideToggle(2000)

TA貢獻1993條經驗 獲得超6個贊
Jquery彈出層窗口,并且背景變暗
先到 下載Jquery的Lee dialog插件,
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無標題文檔</title>
<script language="javascript" src="dialog.js"></script>
<script language="javascript" src="Jquery.js"></script>
<style>
#floatBoxBg
.floatBox
.floatBox .title
.floatBox .title h4
.floatBox .title span
.floatBox .content
</style>
</head>
<body>
<script>
function aa()
{
dialog("我的標題","iframe:login.php","500px","auto","text"); // login.php 為要彈出的窗口
}
</script>
<a href="#" onclick="aa()" >Click Here</a>
</body>
</html>
關于這個dialog插件的其它用法:
get加載一個.html文件(也可以是.php/.asp?id=4之類的)
dialog("我的標題","test.html","200px","auto","text");
彈出純文本內容
dialog("我的標題","text:我的內容","200px","auto","text"); 試試
彈出某id里面的html
頁面有<div id="testID" style="display:none;"><h2>Lee dialog</h2></div>
dialog("我的標題","id:testID","300px","auto","id"); 試試
Lee dialog
加載一個頁面以框架示
把blueidea加載進來,定義css:body .iframe .content復蓋一下,因為.content默認padding:20px;
dialog("blueidea","iframe:","500px","500px","iframe");
- 2 回答
- 0 關注
- 730 瀏覽
添加回答
舉報