HTML:
<input type="button" id="pop" value="Submit"/>
<div id="popup">
<div id="topbar"> TITLE..</div>
<div id="content">Here is you content...</div>
<input type="button" id="ok" value="OK"/>
</div>
CSS:
#popup { background:#ccc; -moz-border-radius: 10px; width:300px; height: 200px; padding: 5px; position: absolute; left: 50%; margin-left: -150px; z-index: 500; display:none }
#topbar { background:#ddd; -moz-border-radius: 10px; padding:5px; height:20px; line-height:20px }
#content { padding:5px; -moz-border-radius: 10px; text-align:center }
#ok { position: absolute; left: 140px; top: 180px }
のjQuery:@Anu's suggestion - my fiddleからのコードを使用して
$(function(){
$('#pop').click(function(){
$('#popup').fadeIn().css('top',$(document).height()/2);
});
$('#ok').click(function(){
$('#popup').fadeOut();
});
});
いいです。私はあなたのためにそれを手に入れましたhttp://jsfiddle.net/mplungjan/xa23e/ – mplungjan
@ mplungjanは素晴らしいですが、今は私が気づいたOPはサーバー側のヘルプも – anu
を求めていますので、スクリプトはサーバーをポーリングする必要があります。いいえ。 setIntervalと$ .get() – mplungjan