jQuery 1.4 Animation Techniques - Index of
jQuery 1.4 Animation Techniques - Index of jQuery 1.4 Animation Techniques - Index of
Time for action – creating a slide-down login form [ 75 ] Chapter 4 In this example we'll see how easy it is to implement a login form that slides open when a link is clicked. It's common practice to include a login link at the top of a page, but usually the whole login form isn't shown. Instead, clicking the link will reveal an inline form that is hidden by default. The following screenshot shows how the page will appear with the login form open: 1. To begin with, add the following code to the of our template file: Already registered? Login Login Form Username: Password: Remember me: Login
Sliding Animations 2. Save the file as slideDown.html in the main project folder. 3. Next let's add the CSS for this example. In a new file in your text editor, add the following code: header { display:block; font-family:Verdana, Arial, Helvetica, sans-serif; } header ul { margin:0; position:relative; float:right; list-style-type:none; font-size:11px; } header ul li { float:left; margin-top:10px; } header ul li a { display:block; margin:-13px 0 0 10px; padding:11px 18px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; font-size:14px; color:#000; } header ul li a:hover, header ul li a:focus, header ul li a.on { padding:3px 10px; border:8px solid #666; background-color:#fff; text-decoration:none; } header ul li a.on { border-bottom:0; padding-bottom:10px; -moz-border-radius-bottomright:0; -moz-border-radius- bottomleft:0; -webkit-border-bottom-right-radius:0; -webkit-border-bottom-left-radius:0; border-bottom-right- radius:0; border-bottom-right-radius:0; position:relative; z-index:10; outline:0; } header form { display:none; width:260px; border:8px solid #666; -moz-border-radius:px; -moz-border-radius-topright:0; -webkit-border-radius:5px; -webkit-border-top-right-radius:0; border-radius:5px; border-top-right-radius:0; position:absolute; right:0; top:27px; z-index:5; } header fieldset { margin:0; padding:20px 10px 10px; border:0; } header legend { display:none; } header form label { display:block; float:right; font-size:14px; } header form label:first-child { margin-bottom:10px; } [ 76 ]
- 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 58 and 59: The fadeTo() method is used in the
- 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 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 132 and 133: [ 111 ] Chapter 5 The previous scre
- 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
Sliding <strong>Animation</strong>s<br />
2. Save the file as slideDown.html in the main project folder.<br />
3. Next let's add the CSS for this example. In a new file in your text editor, add the<br />
following code:<br />
header {<br />
display:block;<br />
font-family:Verdana, Arial, Helvetica, sans-serif;<br />
}<br />
header ul {<br />
margin:0; position:relative; float:right; list-style-type:none;<br />
font-size:11px;<br />
}<br />
header ul li { float:left; margin-top:10px; }<br />
header ul li a {<br />
display:block; margin:-13px 0 0 10px; padding:11px 18px;<br />
-moz-border-radius:5px; -webkit-border-radius:5px;<br />
border-radius:5px; font-size:14px; color:#000;<br />
}<br />
header ul li a:hover, header ul li a:focus, header ul li a.on {<br />
padding:3px 10px; border:8px solid #666; background-color:#fff;<br />
text-decoration:none;<br />
}<br />
header ul li a.on {<br />
border-bottom:0; padding-bottom:10px;<br />
-moz-border-radius-bottomright:0; -moz-border-radius-<br />
bottomleft:0;<br />
-webkit-border-bottom-right-radius:0;<br />
-webkit-border-bottom-left-radius:0; border-bottom-right-<br />
radius:0;<br />
border-bottom-right-radius:0; position:relative; z-index:10;<br />
outline:0;<br />
}<br />
header form {<br />
display:none; width:260px; border:8px solid #666;<br />
-moz-border-radius:px; -moz-border-radius-topright:0;<br />
-webkit-border-radius:5px; -webkit-border-top-right-radius:0;<br />
border-radius:5px; border-top-right-radius:0;<br />
position:absolute; right:0; top:27px; z-index:5;<br />
}<br />
header fieldset { margin:0; padding:20px 10px 10px; border:0; }<br />
header legend { display:none; }<br />
header form label { display:block; float:right; font-size:14px; }<br />
header form label:first-child { margin-bottom:10px; }<br />
[ 76 ]