jQuery 1.4 Animation Techniques - Index of
jQuery 1.4 Animation Techniques - Index of jQuery 1.4 Animation Techniques - Index of
2. Save the new page as marquee.html. [ 221 ] Chapter 8 3. We can also add some basic CSS at this point to layout the example in an acceptable, generic manner. In a new file in your text editor, add the following code: #outer { width:960px; margin:auto; color:#3c3c3c; font:normal 17px "Palatino Linotype", "Book Antiqua", Palatino, serif; } header { display:block; padding:0 20px 0; margin-bottom:40px; border:3px solid #d3d1d1; background-color:#e5e5e5; } hgroup { float:left; } h1, h2 { margin-bottom:10px; } nav { display:block; width:100%; height:40px; clear:both; text-align:right; } article { width:700px; height:900px; border:3px solid #d3d1d1; background-color:#e5e5e5; float:left; } article h1, article p { margin:20px; } p , nav{ font:normal 17px "Nimbus Sans L", "Helvetica Neue", "Franklin Gothic Medium", Sans-serif; } p { margin-top:0; } aside { width:220px; height:900px; border:3px solid #d3d1d1; background-color:#e5e5e5; float:right; } aside div { padding:0 20px 20px; } 4. Save this file as marquee.css in the css directory. Link to this stylesheet from the of the page we just created.
Other Popular Animations What just happened? The underlying HTML represents a typical blog. We've added a series of elements for two reasons, primarily so that we have somewhere to insert the marquee, but also so that we can see why this approach can be necessary. Having the latest posts scrolling across the page near the top of the site ensures that this content is seen straight away, and the fact that it's animated also helps to draw the visitor's attention to it. The CSS used so far is purely to layout the example elements in a precise and mildly aesthetic way, giving us a generic layout and a light skinning. We'll add some more CSS a little later in the example for our dynamically created marquee. At this point, the page should appear like this: Remember, all of the elements in the previous screenshot are there for the marquee to be inserted between. They are not specifically required, and are there for this example. Time for action – retrieving and processing the post list Now we're ready to retrieve the list of latest posts and process them, making them ready to be displayed as items in the marquee. In order to access this data across the Internet from another domain, we need to use JSONP, which stands for JSON with Padding, and involves dynamically creating and injecting a element to the page, although jQuery actually handles this aspect of it for us. [ 222 ]
- Page 191 and 192: Extended Animations with jQuery UI
- Page 193 and 194: Extended Animations with jQuery UI
- Page 195 and 196: Extended Animations with jQuery UI
- Page 197 and 198: Extended Animations with jQuery UI
- Page 199 and 200: Extended Animations with jQuery UI
- Page 201 and 202: Full Page Animations Can we animate
- Page 203 and 204: Full Page Animations display:block;
- 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 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 and 256: CSS3 Animations Units It is of crit
- Page 257 and 258: CSS3 Animations Skew Remember the t
- 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
2. Save the new page as marquee.html.<br />
[ 221 ]<br />
Chapter 8<br />
3. We can also add some basic CSS at this point to layout the example in an acceptable,<br />
generic manner. In a new file in your text editor, add the following code:<br />
#outer {<br />
width:960px; margin:auto; color:#3c3c3c;<br />
font:normal 17px "Palatino Linotype", "Book Antiqua",<br />
Palatino, serif;<br />
}<br />
header {<br />
display:block; padding:0 20px 0; margin-bottom:40px;<br />
border:3px solid #d3d1d1; background-color:#e5e5e5;<br />
}<br />
hgroup { float:left; }<br />
h1, h2 { margin-bottom:10px; }<br />
nav {<br />
display:block; width:100%; height:40px; clear:both;<br />
text-align:right;<br />
}<br />
article {<br />
width:700px; height:900px; border:3px solid #d3d1d1;<br />
background-color:#e5e5e5; float:left;<br />
}<br />
article h1, article p { margin:20px; }<br />
p , nav{<br />
font:normal 17px "Nimbus Sans L", "Helvetica Neue",<br />
"Franklin Gothic Medium", Sans-serif;<br />
}<br />
p { margin-top:0; }<br />
aside {<br />
width:220px; height:900px; border:3px solid #d3d1d1;<br />
background-color:#e5e5e5; float:right;<br />
}<br />
aside div { padding:0 20px 20px; }<br />
4. Save this file as marquee.css in the css directory. Link to this stylesheet from the<br />
<strong>of</strong> the page we just created.