脚本宝典收集整理的这篇文章主要介绍了javascript代码实例教程-jquery 美化弹出提示 漂亮的Dialog 对话框,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。小宝典致力于为广大程序猿(媛)提供高品质的代码服务,请大家多多光顾小站,小宝典在此谢过。 三个不同的效果,分别是普通的警告,确认/取消,带一个输入框
本例用了jquery.alertify.js,请到演示页面查看
css文件也请到演示页面查看@H_304_3@
演示
JavaScript Code
<script tyPE="text/javascript">
$(document).ready(function() {
$(".alert").click(function() {
VAR message = "<h3>Alert Dialog</h3><p>Example of an <strong>Alert Dialog</strong>. You can put any message over here.</p><br/>";
alertify.alert(message);
});
$(".confirm").click(function() {
var message = "<h3>Confirm Dialog</h3><p>Do you want to confirm this?</p><br/>";
alertify.confirm(message, function (e) {
if(e) {
alertify.success("You clicked <strong>OK</strong>");
} else {
alertify.error("You clicked <strong>Cancel</strong>");
}
});
});
$(".prompt").click(function() {
var message = "<h3>PRompt Dialog</h3><p>Please enter a value over here.</p><br/>";
alertify.prompt(message, function (e, str) {
if(e) {
alertify.success("You typed <strong>"+str+"</strong>");
} else {
alertify.error("You clicked <strong>Cancel</strong>");
}
}, "Enter a value");
});
});
</script>
<p class="container">
<ul>
<li><a href="#" class="alert">警告对话框</a></li>
<li><a href="#" class="confirm">确认/取消对话框</a></li>
<li><a href="#" class="prompt">带输入框的对话框</a></li>
</ul><br/>
</p>
觉得可用,就经常来吧! 脚本宝典 欢迎评论哦! js脚本,巧夺天工,精雕玉琢。小宝典献丑了!
以上是脚本宝典为你收集整理的javascript代码实例教程-jquery 美化弹出提示 漂亮的Dialog 对话框全部内容,希望文章能够帮你解决javascript代码实例教程-jquery 美化弹出提示 漂亮的Dialog 对话框所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。