基于Jquery和html5实现炫酷的3D焦点图动画

2020-05-27 18:09:57易采站长站整理

var args = Array.prototype.slice.call( arguments, 1 );

this.each(function() {

var instance = $.data( this, 'gallery' );

if ( !instance ) {
logError( "cannot call methods on gallery prior to initialization; " +
"attempted to call method '" + options + "'" );
return;
}

if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
logError( "no such method '" + options + "' for gallery instance" );
return;
}

instance[ options ].apply( instance, args );

});

}
else {

this.each(function() {

var instance = $.data( this, 'gallery' );
if ( !instance ) {
$.data( this, 'gallery', new $.Gallery( options, this ) );
}
});

}

return this;

};

})( jQuery );

希望本文所述对大家学习javascript程序设计有所帮助。