File tree 1 file changed +12
-12
lines changed
1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -158,12 +158,12 @@ end-users control over page animations by rigging a button they can click to sto
158
158
159
159
```
160
160
// Create a button to stop all animations on the page:
161
- $( "input " ).attr({
162
- type: "button",
163
- value: "Stop All Animations"
164
- }).on ( "click", function() {
165
- $( "body *" ).filter( ":animated" ).stop();
166
- }) .appendTo( document.body );
161
+ $( "<button type='button'></button> " )
162
+ .text( "Stop All Animations" )
163
+ .on( "click", function() {
164
+ $( "body *" ).filter ( ":animated" ).stop();
165
+ })
166
+ .appendTo( document.body );
167
167
```
168
168
169
169
### ` .delay() `
@@ -211,10 +211,10 @@ especially useful when dealing with older browsers; you also may want to
211
211
provide the option to disable all animations to your users.
212
212
213
213
```
214
- $( "input " ).attr({
215
- type: "button",
216
- value: "Disable Animations"
217
- }).on( "click", function() {
218
- jQuery.fx.off = true;
219
- }) .appendTo( document.body );
214
+ $( "<button type='button'></button> " )
215
+ .text( "Disable Animations" )
216
+ .on( "click", function() {
217
+ jQuery.fx.off = true;
218
+ })
219
+ .appendTo( document.body );
220
220
```
You can’t perform that action at this time.
0 commit comments