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.

[ 233 ]<br />

Chapter 9<br />

Translate<br />

Translating an element causes it to move from its original location. Positive values translate<br />

to the right or down the page (depending on the axis), and negative values move it to the<br />

left or up the page. For example, an element could be moved 100 pixels right along the x axis<br />

and 100 pixels down along the y axis using the following transformation matrix:<br />

transform: matrix(1, 0, 0, 1, 100px, 100px);<br />

This matrix function, equivalent to using the transform function: translate(100px,<br />

100px), would cause the targeted element to appear like this:<br />

As we can see in the previous screenshot, the element has moved from its original location<br />

even though it has not been positioned, which we can see is the case in Firebug.<br />

The fifth parameter <strong>of</strong> the matrix in this example corresponds to the x axis, and the sixth<br />

parameter to the y axis. Don't worry too much about the first four parameters as we will<br />

cover these in more detail shortly.

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

Saved successfully!

Ooh no, something went wrong!