02.06.2013 Views

jQuery 1.4 Animation Techniques - Index of

jQuery 1.4 Animation Techniques - Index of

jQuery 1.4 Animation Techniques - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Time for action – animations with show/hide<br />

[ 49 ]<br />

Chapter 2<br />

It's always easiest to add any required HTML and basic CSS first, before adding any behavior<br />

with JavaScript, and this example is no exception.<br />

1. Add the following markup to the <strong>of</strong> the template file:<br />

<br />

<br />

Top Level<br />

Top Level &raquo;<br />

<br />

2nd Level<br />

Link<br />

2nd Level<br />

Link<br />

2nd Level<br />

Link<br />

<br />

<br />

Top Level<br />

Top Level<br />

&raquo;<br />

<br />

2nd Level<br />

Link<br />

2nd Level<br />

Link<br />

2nd Level<br />

Link<br />

<br />

<br />

<br />

<br />

2. Save this file as showHide.html. The following CSS should go into a new file:<br />

nav {<br />

font:normal 18px "Nimbus Sans L", "Helvetica Neue", "Lucida Sans<br />

Unicode", Sans-serif;<br />

}<br />

nav a {<br />

display:block; padding:20px 30px; text-decoration:none;<br />

background-color:#ddd; color:#333; border:1px solid #fff;<br />

}<br />

nav a:hover { background-color:#333; color:#ddd; }

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!