jQuery 1.4 Animation Techniques - Index of
jQuery 1.4 Animation Techniques - Index of jQuery 1.4 Animation Techniques - Index of
In the previous screenshot we can see that the element is now twice its original size. [ 235 ] Chapter 9 The previous code symmetrically scales the target element along both the x and y axes. These values are unit-less in all supporting browsers, and the value 0 cannot be specified. Integers or floating-point numbers may be provided, and the scaling may be asymmetrical if necessary. An interesting effect of scaling is that providing negative values cause the element to be reversed, and not shrunk, as we may intuitively surmise. So if we were to provide -2 and -2 as the first and fourth values in the previous code-snippet, the element would be reflected both vertically and horizontally, as well as being made twice its original size. We can even supply a combination of positive and negative values for this type of transformation. A reflected element would appear like this: The element is reversed along both its x and y axes, as if it were being viewed upside down in a mirror. This could be hugely useful if, for example, we were implementing pure-CSS reflections.
CSS3 Animations Skew Remember the two zero values that correspond to parameters 2 and 3? These can be used as skew values, with the x axis using the second parameter, and the y axis using the third. We could skew an element (without modifying its scale or position) using the following matrix transform function: transform: matrix(1, 1, 0, 1, 0, 0); The following screenshot shows a skewed element: The previous screenshot shows an element skewed along the x axis. As with other matrix functions, positive values for these parameters cause transformation along the right or downwards direction, negative values along the left or up directions. In the previous snippet, only the x axis has been skewed. A consequence of the skew is that the element has grown in size. The bounding box of the transformed element has doubled in size from 200 px (the original size of the element) to 400 px. Regardless of this increase in size however, the flow of the document remains unaffected by the transform, and just like the other transforms, any content within the transformed element also becomes transformed. Text appearance Transforms have a varying impact on any text contained in the element across different browsers, with the text remaining crisp and readable in some browsers following a transform, and degrading in other browsers. [ 236 ]
- Page 205 and 206: Download from Wow! eBook Full Page
- Page 207 and 208: Full Page Animations Have a go hero
- Page 209 and 210: Full Page Animations 4. Save this f
- Page 211 and 212: Full Page Animations 2. The bgpos c
- Page 213 and 214: Full Page Animations nav ul { margi
- Page 215 and 216: Full Page Animations screensize = {
- Page 217 and 218: Full Page Animations What just happ
- Page 219 and 220: Full Page Animations The second sec
- Page 221 and 222: Full Page Animations Pop quiz - cre
- Page 223 and 224: Full Page Animations Time for actio
- Page 225 and 226: Full Page Animations Next we define
- Page 228 and 229: 8 Other Popular Animations This cha
- Page 230 and 231: [ 209 ] Chapter 8 } .slider #scroll
- Page 232 and 233: }), pointerText = "Use your pointer
- Page 234 and 235: [ 213 ] Chapter 8 In the previous s
- Page 236 and 237: prox.mousemove(function(ev) { goAni
- Page 238 and 239: Pop quiz - implementing proximity a
- Page 240 and 241: [ 219 ] Chapter 8 What just happene
- Page 242 and 243: 2. Save the new page as marquee.htm
- Page 244 and 245: [ 223 ] Chapter 8 1. jQuery provide
- Page 246 and 247: clear:both; } div#fadeLeft, div#fad
- Page 248 and 249: Time for action - animating the pos
- Page 250: 2. In this example we used the dele
- Page 253 and 254: CSS3 Animations The following trans
- Page 255: CSS3 Animations Units It is of crit
- Page 259 and 260: CSS3 Animations Calculating the sin
- Page 261 and 262: CSS3 Animations The filter property
- Page 263 and 264: CSS3 Animations If, like me, you th
- Page 265 and 266: CSS3 Animations } el.filters.item("
- Page 267 and 268: CSS3 Animations An unfortunate prob
- Page 269 and 270: CSS3 Animations The context of this
- Page 271 and 272: CSS3 Animations Time for action - i
- Page 273 and 274: CSS3 Animations The first variable
- Page 275 and 276: CSS3 Animations Time for action - a
- Page 277 and 278: Download from Wow! eBook CSS3 Anim
- Page 279 and 280: CSS3 Animations We also have to upd
- Page 281 and 282: CSS3 Animations flatMatrix[3] = fla
- Page 283 and 284: CSS3 Animations When updating the s
- Page 285 and 286: CSS3 Animations translate translate
- Page 287 and 288: Canvas Animations Subjects that we'
- Page 289 and 290: Canvas Animations We can set the co
- Page 291 and 292: Download from Wow! eBook Canvas An
- Page 293 and 294: Canvas Animations All imageData obj
- Page 295 and 296: Canvas Animations context.beginPath
- Page 297 and 298: Canvas Animations For the next part
- Page 299 and 300: Canvas Animations Time for action -
- Page 301 and 302: Canvas Animations 3. Save the new p
- Page 303 and 304: Canvas Animations Time for action -
- Page 305 and 306: Canvas Animations Once the rectangl
CSS3 <strong>Animation</strong>s<br />
Skew<br />
Remember the two zero values that correspond to parameters 2 and 3? These can be used<br />
as skew values, with the x axis using the second parameter, and the y axis using the third.<br />
We could skew an element (without modifying its scale or position) using the following<br />
matrix transform function:<br />
transform: matrix(1, 1, 0, 1, 0, 0);<br />
The following screenshot shows a skewed element:<br />
The previous screenshot shows an element skewed along the x axis. As with other matrix<br />
functions, positive values for these parameters cause transformation along the right or<br />
downwards direction, negative values along the left or up directions.<br />
In the previous snippet, only the x axis has been skewed. A consequence <strong>of</strong> the skew is that<br />
the element has grown in size. The bounding box <strong>of</strong> the transformed element has doubled<br />
in size from 200 px (the original size <strong>of</strong> the element) to 400 px.<br />
Regardless <strong>of</strong> this increase in size however, the flow <strong>of</strong> the document remains unaffected<br />
by the transform, and just like the other transforms, any content within the transformed<br />
element also becomes transformed.<br />
Text appearance<br />
Transforms have a varying impact on any text contained in the element<br />
across different browsers, with the text remaining crisp and readable in<br />
some browsers following a transform, and degrading in other browsers.<br />
[ 236 ]