Mootools 101: A Disappearing (Fading) Notification Message

What I wanted to achieve:

I wanted a disappearing notification message that pops up and fades out when a button is pressed.

What you need:

Mootools Core

How I did it:

Read up on Apress Mootools Essentials for about an hour and experimented on it.

1. Include mootools  and the script in the head.

<script src="mootools-1.2.1-core.js"></script>
<script type="text/javascript">

    function blink() {
        $('blinker').set('opacity',1);
        $('blinker').fade('out');
    }

    window.addEvent('domready',function(){
        $('blinker').set('opacity',0);
    });

</script>

2. Type in the notification message and the button

<div>
    <p id="blinker">This is a disappearing notification message</p>
</div>

<button onclick="blink()">Poink</button>

That’s it folks!

No comments yet.

Leave a Reply

  • google43412
  • google43412
  • google43412
  • bu pos
  • google43412
  • google43412
  • ueio soius
  • google43412
  • google43412