Design a stunning Alert Box using MooTools

本文介绍如何利用MooTools框架设计一个外观华丽且功能强大的警告框。通过简单的步骤安装并定制样式,即可在网页上实现带有动画效果的警告框,提升用户体验。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

THIS IS A VERY GOOD ARTICLE FROM : http://woork.blogspot.com/2008/08/design-stunning-alert-box-using.html

THANKS TO EDUARDO SADA.

Design a stunning Alert Box using MooTools

 

The Script

This tutorial explains how to design a stunning Alert Box which changes and improves the classic look of JavaScript Alert Boxes.

The result is something like these you can see in the previous picture. Alert box appears on the page, above all other page elements with a nice animation. Try it!

Download source code Take a look here for a live preview


1. How to install this script
Downloading the package you have all do you need to use this nice script. First of all, add a link to MooTools Framework and to sexyalertbox.js within the <head> tag of the page in this way:

<script src= "mootools.js" type= "text/javascript" ></script>
<script src= "sexyalertbox.v1.js" type= "text/javascript" ></script>


...then add this link to the CSS file:

<link rel= "stylesheet" href= "sexyalertbox.css" type= "text/css" media= "all" />


...and if you want to change the default look of Alert Box you can customize the CSS file how you prefer.

2. HTML Code
Add this line of code within the <body> tag:

<script type= "text/javascript" >
window.addEvent ( 'domready', function () {
Sexy = new SexyAlertBox ();
});
</script>


...and for example create a link which display an alert box with a simple message "Nice!":

<a href= "#" onclick= "Sexy.alert('Nice!'); return false;" >Show a JavaScript alert with a new look! </a>



In this way when an user click on this link an alert box will appear above all other elements of the page. It's all! For other info, please take a look at the documentation you can find at this link.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值