Commits

Yuki KODAMA committed 5572176

add a new option 'onReady'

  • Participants
  • Parent commits ba7bde7

Comments (0)

Files changed (1)

File jquery.tinyslide.js

                     offsetHeight: data.dots.height()
                 }).hide();
                 sortSlides();
+
+                call('_onReadySlide', self, [slide]);
             };
 
             var img = !anchor ? null : anchor.children('img');
         }, delay);
     },
 
-    _onHoverImage: function(target) {
+    _onHoverImage: function(target, ev) {
         var self = this;
         var data = this.data('tinyslide');
         var opt = data.options;
 
     _onClickImage: function(target, ev) {
         var opt = this.data('tinyslide').options;
-        opt.onClick && opt.onClick.call(target.get(), ev);
+        opt.onClick && opt.onClick.call(target.get(), ev, this);
     },
 
-    _onClickDot: function(target) {
+    _onReadySlide: function(target) {
+        var opt = this.data('tinyslide').options;
+        opt.onReady && opt.onReady.call(target.get(), null, this);
+    },
+
+    _onClickDot: function(target, ev) {
         var self = this;
         var data = this.data('tinyslide');
         var opt = data.options;
             }
         })
 
-        opt.onChange && opt.onChange.call(this.get());
+        opt.onChange && opt.onChange.call(this.get(), null, this);
     },
 
     start: function() {
         var opt = data.options;
         data.status = 'start';
 
-        opt.onStart && opt.onStart.call(this.get());
+        opt.onStart && opt.onStart.call(this.get(), null, this);
     },
 
     pause: function() {
         data.status = 'pause';
         data.time = (new Date()).getTime();
 
-        opt.onPause && opt.onPause.call(this.get());
+        opt.onPause && opt.onPause.call(this.get(), null, this);
     },
 
     next: function() {
     onStart: null,
     onPause: null,
     onChange: null,
-    onClick: null
+    onClick: null,
+    onReady: null
 };
 
 })(jQuery);