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.

[ 77 ]<br />

Chapter 4<br />

header form input {<br />

display:block; width:148px; margin:-2px 0 10px 8px; float:right;<br />

}<br />

header form input#remember { width:auto; margin:3px 0 0 10px; }<br />

header form button {<br />

margin:10px -1px 0 0; float:right; clear:right;<br />

}<br />

4. Save this stylesheet in the css folder as slideDown.css.<br />

5. Finally we should add the script that will enable the slide effect. Within the<br />

anonymous function in the second element, add the following code:<br />

$("#login").click(function(e) {<br />

e.preventDefault();<br />

$(this).addClass("on").next().slideDown();<br />

});<br />

6. When we run the page now, we should see that the hidden form slides open when<br />

the login link is clicked:

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

Saved successfully!

Ooh no, something went wrong!