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.

};<br />

}<br />

};<br />

clearInterval(flatInterval);<br />

clearInterval(preInterval);<br />

if (vendor !== "filter") {<br />

preMatrix[3] = 0;<br />

preMatrix[5] = 0;<br />

preFlat.css(vendor, preMatrix.join(""));<br />

}<br />

flat.removeClass("flat").css("z<strong>Index</strong>",<br />

parseInt(flat.next().css("z<strong>Index</strong>")) + 1);<br />

preFlat.addClass("flat").css("z<strong>Index</strong>", order + 1);<br />

}<br />

} else {<br />

clearInterval(flatInterval);<br />

clearInterval(preInterval);<br />

flat.css("z<strong>Index</strong>", order + 1);<br />

[ 261 ]<br />

Chapter 9<br />

order = flow.children().length;<br />

preMatrix[3] = 30 * oneRad;<br />

preMatrix[5] = 10 * oneRad;<br />

preMatrix[9] = (vendor === "-moz-transform") ? "-90px," : "-90,";<br />

preMatrix[10] = (vendor === "-moz-transform") ? "-30px," :<br />

"-30,";<br />

if(!flatInterval) {<br />

var flatInterval = setInterval(function() { skew() }, 1),<br />

preInterval = setInterval(function() { skew() }, 1);<br />

}<br />

What just happened?<br />

We won't cover the whole function in its entirety as it's very similar to before, but let's take<br />

a moment to look at what differs in this function. First, instead <strong>of</strong> selecting the next image<br />

to the right <strong>of</strong> the flat element, we select the one to the left <strong>of</strong> it using <strong>jQuery</strong>'s prev()<br />

method instead <strong>of</strong> next().

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

Saved successfully!

Ooh no, something went wrong!