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.

Other Popular <strong>Animation</strong>s<br />

}<br />

$("", {<br />

href: data.posts[x].url,<br />

title: data.posts[x].title,<br />

html: data.posts[x].title<br />

}).appendTo(marquee);<br />

marquee.wrapInner("").prepend(h2).append(fadeLeft)<br />

.append(fadeRight).insertAfter("header").slideDown("slow");<br />

$("#marquee").find("div").eq(0).width(function() {<br />

var width = 0;<br />

$(this).children().each(function() {<br />

var el = $(this);<br />

width += el.width() + parseInt(el.css("marginRight"));<br />

});<br />

return width;<br />

});<br />

marquee.trigger("marquee-ready");<br />

});<br />

4. We can also add some more CSS, this time for the newly-created elements. Add the<br />

following code to the bottom <strong>of</strong> marquee.css:<br />

#marquee {<br />

display:none; height:58px; margin:-20px 0 20px;<br />

border:3px solid #d3d1d1; position:relative;<br />

overflow:hidden;<br />

background-color:#e5e5e5;<br />

}<br />

#marquee h2 { margin:0; position:absolute; top:10px; left:20px; }<br />

#marquee a {<br />

display:block; margin-right:20px; float:left;<br />

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

"Franklin Gothic Medium", Sans-serif;<br />

}<br />

#marquee div { margin:20px 0 0 210px; overflow:hidden; }<br />

#marquee div:after {<br />

content:""; display:block; height:0; visibility:hidden;<br />

[ 224 ]

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

Saved successfully!

Ooh no, something went wrong!