Skip to content

Commit de242d8

Browse files
committed
Effects: Style updates
Ref #14246 Ref jquerygh-1588
1 parent 009850a commit de242d8

9 files changed

Lines changed: 226 additions & 208 deletions

File tree

demos/effect/default.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// get effect type from
2020
var selectedEffect = $( "#effectTypes" ).val();
2121

22-
// most effect types need no options passed by default
22+
// Most effect types need no options passed by default
2323
var options = {};
2424
// some effects have required parameters
2525
if ( selectedEffect === "scale" ) {
@@ -30,18 +30,18 @@
3030
options = { to: { width: 200, height: 60 } };
3131
}
3232

33-
// run the effect
33+
// Run the effect
3434
$( "#effect" ).effect( selectedEffect, options, 500, callback );
3535
};
3636

37-
// callback function to bring a hidden box back
37+
// Callback function to bring a hidden box back
3838
function callback() {
3939
setTimeout(function() {
4040
$( "#effect" ).removeAttr( "style" ).hide().fadeIn();
4141
}, 1000 );
4242
};
4343

44-
// set effect from select menu value
44+
// Set effect from select menu value
4545
$( "#button" ).on( "click", function() {
4646
runEffect();
4747
return false;

demos/effect/easing.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
ctx = canvas.getContext( "2d" );
3838
ctx.fillStyle = "black";
3939

40-
// draw background
40+
// Draw background
4141
ctx.beginPath();
4242
ctx.moveTo( cradius, 0 );
4343
ctx.quadraticCurveTo( 0, 0, 0, cradius );
@@ -49,21 +49,21 @@
4949
ctx.lineTo( cradius, 0 );
5050
ctx.fill();
5151

52-
// draw bottom line
52+
// Draw bottom line
5353
ctx.strokeStyle = "#555";
5454
ctx.beginPath();
5555
ctx.moveTo( width * 0.1, drawHeight + .5 );
5656
ctx.lineTo( width * 0.9, drawHeight + .5 );
5757
ctx.stroke();
5858

59-
// draw top line
59+
// Draw top line
6060
ctx.strokeStyle = "#555";
6161
ctx.beginPath();
6262
ctx.moveTo( width * 0.1, drawHeight * .3 - .5 );
6363
ctx.lineTo( width * 0.9, drawHeight * .3 - .5 );
6464
ctx.stroke();
6565

66-
// plot easing
66+
// Plot easing
6767
ctx.strokeStyle = "white";
6868
ctx.beginPath();
6969
ctx.lineWidth = 2;
@@ -76,7 +76,7 @@
7676
});
7777
ctx.stroke();
7878

79-
// animate on click
79+
// Animate on click
8080
graph.on( "click", function() {
8181
wrap
8282
.animate( { height: "hide" }, 2000, name )

demos/effect/hide.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// get effect type from
1919
var selectedEffect = $( "#effectTypes" ).val();
2020

21-
// most effect types need no options passed by default
21+
// Most effect types need no options passed by default
2222
var options = {};
2323
// some effects have required parameters
2424
if ( selectedEffect === "scale" ) {
@@ -27,18 +27,18 @@
2727
options = { to: { width: 200, height: 60 } };
2828
}
2929

30-
// run the effect
30+
// Run the effect
3131
$( "#effect" ).hide( selectedEffect, options, 1000, callback );
3232
};
3333

34-
// callback function to bring a hidden box back
34+
// Callback function to bring a hidden box back
3535
function callback() {
3636
setTimeout(function() {
3737
$( "#effect" ).removeAttr( "style" ).hide().fadeIn();
3838
}, 1000 );
3939
};
4040

41-
// set effect from select menu value
41+
// Set effect from select menu value
4242
$( "#button" ).on( "click", function() {
4343
runEffect();
4444
});

demos/effect/show.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// get effect type from
1919
var selectedEffect = $( "#effectTypes" ).val();
2020

21-
// most effect types need no options passed by default
21+
// Most effect types need no options passed by default
2222
var options = {};
2323
// some effects have required parameters
2424
if ( selectedEffect === "scale" ) {
@@ -27,7 +27,7 @@
2727
options = { to: { width: 280, height: 185 } };
2828
}
2929

30-
// run the effect
30+
// Run the effect
3131
$( "#effect" ).show( selectedEffect, options, 500, callback );
3232
};
3333

@@ -38,7 +38,7 @@
3838
}, 1000 );
3939
};
4040

41-
// set effect from select menu value
41+
// Set effect from select menu value
4242
$( "#button" ).on( "click", function() {
4343
runEffect();
4444
});

demos/effect/toggle.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// get effect type from
3434
var selectedEffect = $( "#effectTypes" ).val();
3535

36-
// most effect types need no options passed by default
36+
// Most effect types need no options passed by default
3737
var options = {};
3838
// some effects have required parameters
3939
if ( selectedEffect === "scale" ) {
@@ -42,11 +42,11 @@
4242
options = { to: { width: 200, height: 60 } };
4343
}
4444

45-
// run the effect
45+
// Run the effect
4646
$( "#effect" ).toggle( selectedEffect, options, 500 );
4747
};
4848

49-
// set effect from select menu value
49+
// Set effect from select menu value
5050
$( "#button" ).on( "click", function() {
5151
runEffect();
5252
});

tests/unit/effects/core.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function notPresent( value, array, message ) {
3030
// minDuration is used for "short" animate tests where we are only concerned about the final
3131
var minDuration = 15,
3232

33-
// duration is used for "long" animates where we plan on testing properties during animation
33+
// Duration is used for "long" animates where we plan on testing properties during animation
3434
duration = 200;
3535

3636
module( "effects.core" );
@@ -115,11 +115,11 @@ asyncTest( "animateClass works with colors", function() {
115115

116116
expect(2);
117117

118-
// we want to catch the first frame of animation
118+
// We want to catch the first frame of animation
119119
jQuery.fx.step.backgroundColor = function( fx ) {
120120
oldStep.apply( this, arguments );
121121

122-
// make sure it has animated somewhere we can detect
122+
// Make sure it has animated somewhere we can detect
123123
if ( fx.pos > 255 / 2000 ) {
124124
jQuery.fx.step.backgroundColor = oldStep;
125125
notPresent( test.css("backgroundColor"),
@@ -206,14 +206,14 @@ function( assert ) {
206206
expect( 2 );
207207
var test = $( "div.ticket7106" );
208208

209-
// ensure the class stays and that the css property stays
209+
// Ensure the class stays and that the css property stays
210210
function animationComplete() {
211211
assert.hasClasses( test, "testClass", "class change during animateClass was not lost" );
212212
equal( test.height(), 100, "css change during animateClass was not lost" );
213213
start();
214214
}
215215

216-
// add a class and change a style property after starting an animated class
216+
// Add a class and change a style property after starting an animated class
217217
test.addClass( "animate", minDuration, animationComplete )
218218
.addClass( "testClass" )
219219
.height( 100 );

0 commit comments

Comments
 (0)