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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

clear:both;<br />

}<br />

div#fadeLeft, div#fadeRight {<br />

width:48px; height:21px; margin:0; position:absolute;<br />

top:17px;<br />

left:210px; background:url(../img/fadeLeft.png) no-repeat;<br />

}<br />

div#fadeRight {<br />

left:906px; background:url(../img/fadeRight.png) no-repeat;<br />

}<br />

[ 225 ]<br />

Chapter 8<br />

5. When we run the page now, we should see that the new marquee element, along<br />

with its links, is inserted into the page:<br />

The previous screenshot shows the elements in the new marquee section including the<br />

heading, the links themselves, and the fade elements which are added purely for aesthetics.<br />

What just happened?<br />

All <strong>of</strong> our JavaScript is wrapped up in <strong>jQuery</strong>'s getJSON() method, which uses <strong>jQuery</strong>'s AJAX<br />

functionality to make a request to the URL specified as the first argument to the method. The<br />

second argument is an anonymous function that is executed if the request is successful. The<br />

returned JSON data is passed to this function automatically.

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

Saved successfully!

Ooh no, something went wrong!