Call Preload Function [duplicate]
Possible Duplicate:
Preload Function
that is my js code. https://github.com/nathansearles/Slides/blob/master/source/slides.js
preload : function() {
$('.slidesContainer').css({
backgroundImage: "url(img/loading.gif)",
backgroundPosition: "50% 50%",
backgroundRepeat: "no-repeat"
});
this._loadImage( this.slides.eq( this.options.startAtSlide - 1 ).attr("src") ).then( $.proxy(function( url ) {
this.slidesCon开发者_如何学Ctrol.fadeIn( this.options.fade.interval );
this._trigger( "loaded", this.options.startAtSlide, this );
},this));
},
How I can use this code. I am call so $("#slides").slides("preload");. But If I am using $("#slides").slides(); before $("#slides").slides("preload"); that is works. How I can call only preload.?
Thanks..
Since slider is a widget you cannot call preload
directly without creating the instance of it which is done by $("#slides").slides();
. You can have call it before calling preload
to make it work.
精彩评论