Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Intro to Effects: Fix generation of buttons.

  • Loading branch information...
commit 847d6681b4ae4a2defd6103d9c117822b9a9c5cb 1 parent 4df62ec
@scottgonzalez scottgonzalez authored
Showing with 12 additions and 12 deletions.
  1. +12 −12 page/effects/intro-to-effects.md
View
24 page/effects/intro-to-effects.md
@@ -158,12 +158,12 @@ end-users control over page animations by rigging a button they can click to sto
```
// Create a button to stop all animations on the page:
-$( "input" ).attr({
- type: "button",
- value: "Stop All Animations"
-}).on( "click", function() {
- $( "body *" ).filter( ":animated" ).stop();
-}).appendTo( document.body );
+$( "<button type='button'></button>" )
+ .text( "Stop All Animations" )
+ .on( "click", function() {
+ $( "body *" ).filter( ":animated" ).stop();
+ })
+ .appendTo( document.body );
```
### `.delay()`
@@ -211,10 +211,10 @@ especially useful when dealing with older browsers; you also may want to
provide the option to disable all animations to your users.
```
-$( "input" ).attr({
- type: "button",
- value: "Disable Animations"
-}).on( "click", function() {
- jQuery.fx.off = true;
-}).appendTo( document.body );
+$( "<button type='button'></button>" )
+ .text( "Disable Animations" )
+ .on( "click", function() {
+ jQuery.fx.off = true;
+ })
+ .appendTo( document.body );
```
Please sign in to comment.
Something went wrong with that request. Please try again.