简体   繁体   中英

How to make simple web dialog for web page

I'm new in the web programing. I'm making a web side and I wan to use lots of web dialogs like the ones in tweeter or fb. They are not pop-up windows and I guess can't be blocked by the browser. I have try to find some information about how to make this dialogs but can't find something useful for me. Can you place help me to solve my problem. I have menage to make some very simple one :

  <script type="text/javascript">
function myDialog() {
   alert("Thanks for clcking the button");  
   }
  </script>
<input type="button" onclick="myDialog()" />

but this is just a message. I need one dialog for log-in and make a new post and... Btw I'm using spring mvc for this project.
Thanks in advice!

您可以为此使用jquery对话框。请检查以下url http://jqueryui.com/dialog/中的信息

看看Eric Martin的SimpleModal

Here is one i whipped together.

<script type="text/javascript">
 function showHide(obj) {
   var div = document.getElementById(obj);
   if (div.style.display == 'none') {
     div.style.display = '';
   }
   else {
     div.style.display = 'none';
   }
 }



</script>





Then call it like so:

Code:
<a href="#" onclick="showHide('hidden_div'); return false;">Some Text</a>

<div id="hidden_div" style="display: none; text-align: center; vertical-align:middle; opacity:0.9;background-color:#ccc; position:fixed; width:100%; height:100%; top:0px; left:0px; z-index:1000;">
<br/><br/><br/>
Hi there I am a message.
<br/>
<a href="#" onclick="showHide('hidden_div'); return false;">Close with an url.</a>
<br/>
Or
<br/>
<input type="button" onclick="showHide('hidden_div'); return false;" value="Close with a button">
<br/>
</div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM