jQuery 1.4 Animation Techniques - Index of
jQuery 1.4 Animation Techniques - Index of jQuery 1.4 Animation Techniques - Index of
The fadeTo() method is used in the following way: jQuery(elements).fadeTo(duration, ending-opacity, [easing], [callback]); [ 37 ] Chapter 2 Animating to partial opacity In this example we have a table in which certain rows can be removed. When one of the rows is selected for removal by the user, we can animate the row to partial opacity while requesting confirmation of the removal. In this section we will cover the following topics: The required arguments of the fadeTo() method Setting a specific ending opacity A work-around for fading table-rows in IE Once a table row has been faded, it will appear like this: The middle row of the table shown in the previous screenshot has been faded to 50 % opacity.
Fading Animations Time for action – creating the example page This example requires significantly more HTML than before, although we still add this, as well as the styling first. 1. Begin by adding the following example markup to our template file: Private Messages RecievedSubjectFromDelete TodayRe: tomorrowBobx TodayRe: tomorrowBill x TodayRe: tomorrow x YesterdayRe: tomorrow x YesterdayRe: tomorrow x 2. Save this page as fadeTo.html in the main project folder. 3. To create the stylesheet for this example, add the following code in a new file in your text editor: #messageList { width:540px; padding:10px 20px; margin:auto; font:normal 14px "Nimbus Sans L", "Helvetica Neue", "Franklin Gothic Medium", Sans-serif; background-color:#666; border:1px solid #aaa; -moz-border-radius:7px; -webkit-border-radius:7px; border-radius:7px; } #messageList header { color:#eee; padding-left:10px; font-size:20px; } [ 38 ]
- Page 8 and 9: Cyril Pierron is an engineer, a web
- Page 12: For Pat Spacagna, the greatest moth
- Page 15 and 16: Download from Wow! eBook Table of
- Page 17 and 18: Table of Contents Time for action -
- Page 19 and 20: Table of Contents jQuery and transf
- Page 21 and 22: Drawing to the canvas 309 Supportin
- Page 23 and 24: Preface What this book covers Chapt
- Page 25 and 26: Preface Have a go hero - heading Th
- Page 27 and 28: Preface Piracy Piracy of copyright
- Page 29 and 30: Introduction In addition to animate
- Page 31 and 32: Introduction When not to use animat
- Page 33 and 34: Introduction of the template file"
- Page 35 and 36: Introduction In the previous screen
- Page 37 and 38: Introduction Once our variables hav
- Page 40 and 41: 2 Fading Animations In this chapter
- Page 42 and 43: [ 21 ] Chapter 2 We can control the
- Page 44 and 45: The previous screenshot shows how t
- Page 46 and 47: [ 25 ] Chapter 2 Most of the styles
- Page 48 and 49: 2. What else can be passed into the
- Page 50 and 51: Time for action - creating the dial
- Page 52 and 53: [ 31 ] Chapter 2 For example, the a
- Page 54 and 55: Download from Wow! eBook The follo
- Page 56 and 57: [ 35 ] Chapter 2 The CSS is used mo
- Page 60 and 61: [ 39 ] Chapter 2 #messageList table
- Page 62 and 63: [ 41 ] Chapter 2 What just happened
- Page 64 and 65: 2. What format can these arguments
- Page 66 and 67: } var el = $(this); if (el.css("fil
- Page 68 and 69: [ 47 ] Chapter 2 Usually these meth
- Page 70 and 71: Time for action - animations with s
- Page 72 and 73: Download from Wow! eBook [ 51 ] Ch
- Page 74 and 75: 2. Save the changes as toggle.html.
- Page 76 and 77: 3 Managing Animations Like most of
- Page 78 and 79: [ 57 ] Chapter 3 A custom queue tha
- Page 80 and 81: If we wish to see how many function
- Page 82 and 83: 2. What does the queue() method ret
- Page 84 and 85: [ 63 ] Chapter 3 The argument we su
- Page 86 and 87: [ 65 ] Chapter 3 We pass a callback
- Page 88 and 89: [ 67 ] Chapter 3 The first argument
- Page 90 and 91: Delaying queue execution [ 69 ] Cha
- Page 92 and 93: [ 71 ] Chapter 3 Also note that the
- Page 94 and 95: 4 Sliding Animations Another type o
- Page 96 and 97: Time for action - creating a slide-
- Page 98 and 99: [ 77 ] Chapter 4 header form input
- Page 100 and 101: Pop quiz - sliding elements down 1.
- Page 102 and 103: Download from Wow! eBook }); }); $
- Page 104 and 105: Toggling the slide [ 83 ] Chapter 4
- Page 106 and 107: [ 85 ] Chapter 4 } h2 { margin:0; p
The fadeTo() method is used in the following way:<br />
<strong>jQuery</strong>(elements).fadeTo(duration, ending-opacity, [easing],<br />
[callback]);<br />
[ 37 ]<br />
Chapter 2<br />
Animating to partial opacity<br />
In this example we have a table in which certain rows can be removed. When one <strong>of</strong> the<br />
rows is selected for removal by the user, we can animate the row to partial opacity while<br />
requesting confirmation <strong>of</strong> the removal. In this section we will cover the following topics:<br />
The required arguments <strong>of</strong> the fadeTo() method<br />
Setting a specific ending opacity<br />
A work-around for fading table-rows in IE<br />
Once a table row has been faded, it will appear like this:<br />
The middle row <strong>of</strong> the table shown in the previous screenshot has been faded<br />
to 50 % opacity.