jquery 美化弹出提示 漂亮的Dialog 对话框

三个不同的效果,分别是普通的警告,确认/取消,带一个输入框

本例用了jquery.alertify.js,请到演示页面查看

css文件也请到演示页面查看

jquery 美化弹出提示 漂亮的Dialog 对话框

 

 

JavaScript Code
  1. <script type="text/javascript">  
  2. $(document).ready(function() {  
  3.     $(".alert").click(function() {  
  4.         var message = "<h3>Alert Dialog</h3><p>Example of an <strong>Alert Dialog</strong>. You can put any message over here.</p><br/>";  
  5.   
  6.         alertify.alert(message);  
  7.     });  
  8.   
  9.     $(".confirm").click(function() {  
  10.         var message = "<h3>Confirm Dialog</h3><p>Do you want to confirm this?</p><br/>";  
  11.   
  12.         alertify.confirm(message, function (e) {  
  13.             if(e) {  
  14.                 alertify.success("You clicked <strong>OK</strong>");  
  15.             } else {  
  16.                 alertify.error("You clicked <strong>Cancel</strong>");  
  17.             }  
  18.         });  
  19.     });  
  20.   
  21.     $(".prompt").click(function() {  
  22.         var message = "<h3>Prompt Dialog</h3><p>Please enter a value over here.</p><br/>";  
  23.   
  24.         alertify.prompt(message, function (e, str) {  
  25.             if(e) {  
  26.                 alertify.success("You typed <strong>"+str+"</strong>");               
  27.             } else {  
  28.                 alertify.error("You clicked <strong>Cancel</strong>");  
  29.             }  
  30.         }, "Enter a value");  
  31.     });  
  32. });  
  33. </script>  

 

XML/HTML Code
  1. <div class="container">  
  2.         <ul>  
  3.             <li><a href="#" class="alert">警告对话框</a></li>  
  4.             <li><a href="#" class="confirm">确认/取消对话框</a></li>  
  5.             <li><a href="#" class="prompt">带输入框的对话框</a></li>  
  6.         </ul><br/>  
  7.   
  8.           
  9.   
  10.     </div>  

 


原文地址:http://www.freejs.net/article_biaodan_83.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值