jQuery 1.4 Animation Techniques - Index of
jQuery 1.4 Animation Techniques - Index of jQuery 1.4 Animation Techniques - Index of
[ 111 ] Chapter 5 The previous screenshot shows the widget in its un-skinned state, with only the CSS required for it to function included. Skinning the widget 'There's more than one way to skin a cat' was once proclaimed, and this applies to widgets as well as cats. Lastly, let's add some custom styling to the widget to see how easy it is to make the widget attractive as well as functional. Time for action – adding a new skin At the bottom of the animate-position.css file, add the following code: a { outline:0 none; } #slider { border:1px solid #999; -moz-border-radius:8px; -webkit-border-radius:8px; border-radius:8px; background-color:#ededed; -moz-box-shadow:0px 2px 7px #aaa; -webkit-box-shadow:0px 2px 7px #aaa; box-shadow:0px 2px 7px #aaa; } #title, #slider ul { margin-top:10px; margin-bottom:12px; } #title { font:normal 22px "Nimbus Sans L", "Helvetica Neue", "Franklin Gothic Medium", Sans-serif;
Custom Animations color:#444; } #viewer { border:1px solid #999; background-color:#fff; } #slider ul { width:120px; } #slider ul li a { display:block; width:10px; height:10px; text-indent:-5000px; text-decoration:none; border:2px solid #666; -moz-border-radius:17px; -webkit-border-radius:17px; border-radius:17px; background-color:#fff; text-align:center; } #slider #prev, #slider #next { margin:0; text-align:center; } #slider #prev { left:10px; } #slider #prev a, #slider #next a { display:block; height:28px; width:28px; line-height:22px; text-indent:0; border:1px solid #666; -moz-border-radius:17px; -webkit-border-radius:17px; border-radius:17px; background-color:#fff; } #prev a, #next a { font:bold 40px "Trebuchet MS"; color:#666; } #slider ul li a.active { background-color:#F93; } What just happened? With this code we style all of the visual aspects of the widget without interfering with anything that controls how it works. We give it some nice rounded corners and add a drop-shadow to the widget, turn the numeric links into little clickable icons, and style the previous and next links. Colors and fonts are also set in this section as they too are obviously highly dependent on the theme. These styles add a basic, neutral theme to the widget, as shown in the following screenshot: [ 112 ]
- 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
- Page 108 and 109: [ 87 ] Chapter 4 The previous scree
- Page 110 and 111: Pop quiz - using slideToggle 1. Wha
- Page 112 and 113: [ 91 ] Chapter 4 Easing is a great
- Page 114 and 115: [ 93 ] Chapter 4 Home Articles J
- Page 116 and 117: [ 95 ] Chapter 4 3. Save this file
- Page 118 and 119: In the previous screenshot, we see
- Page 120 and 121: Pop quiz - fixing the flicker 1. Wh
- Page 122 and 123: 5 Custom Animations The predefined
- Page 124 and 125: An alternative syntax for animate()
- Page 126 and 127: [ 105 ] Chapter 5 width:295px; marg
- Page 128 and 129: [ 107 ] Chapter 5 What just happene
- Page 130 and 131: [ 109 ] Chapter 5 Although not esse
- Page 134 and 135: [ 113 ] Chapter 5 The styles we use
- Page 136 and 137: [ 115 ] Chapter 5 What just happene
- Page 138 and 139: }, html: copy, width: expander.widt
- Page 140 and 141: [ 119 ] Chapter 5 If the image alre
- Page 142 and 143: [ 121 ] Chapter 5 d. Two objects wh
- Page 144 and 145: [ 123 ] Chapter 5 text-align:center
- Page 146 and 147: [ 125 ] Chapter 5 What just happene
- Page 148 and 149: [ 127 ] Chapter 5 Finally, we retur
- Page 150 and 151: [ 129 ] Chapter 5 Once we've define
- Page 152 and 153: } }; $(config.selector).find("a").c
- Page 154 and 155: [ 133 ] Chapter 5 In the previous s
- Page 156: Have a go hero - extending the plug
- Page 159 and 160: Extended Animations with jQuery UI
- Page 161 and 162: Extended Animations with jQuery UI
- Page 163 and 164: Extended Animations with jQuery UI
- Page 165 and 166: Extended Animations with jQuery UI
- Page 167 and 168: Extended Animations with jQuery UI
- Page 169 and 170: Extended Animations with jQuery UI
- Page 171 and 172: Download from Wow! eBook Extended
- Page 173 and 174: Extended Animations with jQuery UI
- Page 175 and 176: Extended Animations with jQuery UI
- Page 177 and 178: Extended Animations with jQuery UI
- Page 179 and 180: Extended Animations with jQuery UI
- Page 181 and 182: Extended Animations with jQuery UI
[ 111 ]<br />
Chapter 5<br />
The previous screenshot shows the widget in its un-skinned state, with only the CSS required<br />
for it to function included.<br />
Skinning the widget<br />
'There's more than one way to skin a cat' was once proclaimed, and this applies to widgets as<br />
well as cats. Lastly, let's add some custom styling to the widget to see how easy it is to make<br />
the widget attractive as well as functional.<br />
Time for action – adding a new skin<br />
At the bottom <strong>of</strong> the animate-position.css file, add the following code:<br />
a { outline:0 none; }<br />
#slider {<br />
border:1px solid #999; -moz-border-radius:8px;<br />
-webkit-border-radius:8px; border-radius:8px;<br />
background-color:#ededed; -moz-box-shadow:0px 2px 7px #aaa;<br />
-webkit-box-shadow:0px 2px 7px #aaa; box-shadow:0px 2px 7px #aaa;<br />
}<br />
#title, #slider ul { margin-top:10px; margin-bottom:12px; }<br />
#title {<br />
font:normal 22px "Nimbus Sans L", "Helvetica Neue", "Franklin<br />
Gothic Medium", Sans-serif;