Permalink
Browse files

changed the opt.show = 0 + (opt.mode == "show") to opt.show = opt.mode

=== "show".

This given i made some changes to some of the uses of opt.show
  • Loading branch information...
1 parent 19c4c89 commit c9c21cd21b41a6383ece51b8471adcf581e72e56 Jesper Lindstroem Nielsen committed Apr 27, 2011
Showing with 16 additions and 10 deletions.
  1. +16 −10 ui/jquery.effects.split.js
View
@@ -16,6 +16,7 @@
//Helper function to control the split on each animation
function startSplitAnim( el, o, animation, next ) {
+
//Support for pieces
if ( ( !o.rows || !o.columns ) && o.pieces ) {
o.rows = o.columns = Math.round( Math.sqrt( o.pieces ) );
@@ -93,6 +94,7 @@
* pieces
*/
$.effects.piecer = function( el, o ){
+
//Support pieces
if ( ( !o.rows || !o.columns ) && o.pieces ) {
o.rows = o.columns = Math.round( Math.sqrt( o.pieces ) );
@@ -154,6 +156,7 @@
}
$.effects.effect.build = function( o ){
+
/*Options:
* random,
* reverse,
@@ -194,7 +197,7 @@
//Sets mode for toggle
opt.mode = $.effects.setMode( el, opt.mode );
- opt.show = 0 + ( opt.mode == 'show' );
+ opt.show = opt.mode === 'show';
function animate( width, height, interval, duration, row, column, documentCoords, parentCoords, callback ) {
var random = opt.random ? Math.abs( opt.random ) : 0,
@@ -213,7 +216,7 @@
properties.left -= parentCoords.left;
if ( opt.fade ) {
- properties.opacity = opt.show;
+ properties.opacity = ( opt.show ? 1 : 0 );
el.css( 'opacity', opt.show ? 0 : '' );
}
@@ -260,6 +263,7 @@
}
$.effects.effect.pinwheel = function( o ) {
+
/*Options:
* random,
* reverse,
@@ -299,7 +303,7 @@
//Sets mode for toggle
opt.mode = $.effects.setMode( el, opt.mode );
- opt.show = 0 + ( opt.mode == 'show' );
+ opt.show = opt.mode === 'show';
function animate( width, height, interval, duration, row, column, documentCoords, parentCoords, callback ) {
var random = opt.random ? Math.abs( opt.random ) : 0,
@@ -332,7 +336,7 @@
}
if ( opt.fade ) {
- properties.opacity = opt.show;
+ properties.opacity = ( opt.show ? 1 : 0 );
startProperties.opacity = 1;
}
@@ -366,6 +370,7 @@
}
$.effects.effect.blockfade = function( o ) {
+
/*Options:
* random,
* reverse,
@@ -399,7 +404,7 @@
//Sets mode for toggle
opt.mode = $.effects.setMode( el, opt.mode );
- opt.show = 0 + ( opt.mode == 'show' );
+ opt.show = opt.mode === 'show';
function animate( width, height, interval, duration, row, column, documentCoords, parentCoords, callback ) {
var random = opt.random ? Math.abs( opt.random ) : 0,
@@ -414,14 +419,15 @@
el.css( 'opacity', 0 );
}
- el.delay( delay ).animate( { opacity: opt.show }, duration, opt.easing, callback );
+ el.delay( delay ).animate( { opacity: ( opt.show ? 1 : 0 ) }, duration, opt.easing, callback );
}
startSplitAnim( el, opt, animate, next );
} );
}
$.effects.effect.sexplode = function( o ) {
+
/*Options:
* random,
* reverse,
@@ -438,7 +444,7 @@
* show,
* crop
*/
-
+
return this.queue( function( next ) {
var opt = $.extend( {
@@ -463,7 +469,7 @@
opt.reverse = !opt.reverse;
}
- opt.show = 0 + ( opt.mode == 'show' );
+ opt.show = opt.mode === 'show';
function animate( width, height, interval, duration, row, column, documentCoords, parentCoords, callback ) {
var el = $( this ),
@@ -483,7 +489,7 @@
properties = $.extend( {}, startProperties );
if ( opt.fade ) {
- properties.opacity = opt.show;
+ properties.opacity = ( opt.show ? 1 : 0 );
startProperties.opacity = 1;
}
@@ -556,7 +562,7 @@
//Support for toggle
opt.mode = $.effects.setMode( el, opt.mode );
- opt.show = 0 + ( opt.mode == 'show' );
+ opt.show = opt.mode === 'show';
function animate( width, height, interval, duration, row, column, documentCoords, parentCoords, callback ) {
var random = opt.random ? Math.abs( opt.random ) : 0,

0 comments on commit c9c21cd

Please sign in to comment.