Skip to Main Content
MooTools 1.3 Cookbook
book

MooTools 1.3 Cookbook

by Jay L Johnston
July 2011
Intermediate to advanced content levelIntermediate to advanced
276 pages
5h 11m
English
Packt Publishing
Content preview from MooTools 1.3 Cookbook

Making a little duck bounce when clicked

This is arguably useful at best, but, goodness gracious, it is goobly goblets of fun!

Making a little duck bounce when clicked

Getting ready

Position the standing and bouncing versions of our duck, stacked in absolute positioning so that the standing version obscures the bouncing version.

<div id="main">
<div id="duck_it">
<img src="08_duck_bounce.jpg" alt="Ouch!"
title="Ouch!" id="bounce"/>
<img src="08_duck_stand.jpg" alt="Click me!"
title="Click me!" id="stand"/>
</div>
</div>
<style type="text/css">
#main { width:600px; margin:auto; }
#duck_it { margin-top:10px; cursor:pointer; }
#duck_it img { position:absolute; }
</style>

How to do it...

The ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Jump Start Web Performance

Jump Start Web Performance

Craig Buckler

Publisher Resources

ISBN: 9781849515689Other