Skip to content

Commit f00c444

Browse files
committed
Adding options callback function that will run after the debounced "resize" event completes...
1 parent d1294f6 commit f00c444

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ autoPlay | Object | autoPlay: { enable: false, interval: 5000, pauseOnHover: tru
6464
loaded | function | function(object) { } | Callback function that runs after the slider is loaded and initialized. A jQuery reference to the instance of the carousel is passed in as the first argument. | loaded: function(object) { console.log('Slider loaded...'); }
6565
before | function | function(object) { } | Callback function that runs before a slide transition. A jQuery reference to the instance of the carousel is passed in as the first argument. | before: function(object) { console.log('Before transition...'); }
6666
after | function | function(object) { } | Callback function that runs after a slide transition. A jQuery reference to the instance of the carousel is passed in as the first argument. | after: function(object) { console.log('After transition...'); }
67+
resize | function | function(object) { } | Callback function that runs after a throttled resize event finishes. A jQuery reference to the instance of the carousel is passed in as the first argument. | resize: function(object) { console.log('After resize...'); }
6768

6869

6970
### Responsive Breakpoints

index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ <h1>Flexisel</h1>
102102
},
103103
after: function(object) {
104104
console.log('After transition...');
105+
},
106+
resize: function(object){
107+
console.log('After resize...');
105108
}
106109
});
107110

js/jquery.flexisel.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* File: jquery.flexisel.js
3-
* Version: 2.2.1
3+
* Version: 2.2.2
44
* Description: Responsive carousel jQuery plugin
55
* Author: 9bit Studios
66
* Copyright 2016, 9bit Studios
@@ -43,7 +43,8 @@
4343
},
4444
loaded: function(){ },
4545
before: function(){ },
46-
after: function(){ }
46+
after: function(){ },
47+
resize: function(){ }
4748
}, options);
4849

4950
/******************************
@@ -133,7 +134,7 @@
133134
Set Event Handlers
134135
*******************************/
135136
setEventHandlers: function() {
136-
137+
var self = this;
137138
var childSet = object.children();
138139

139140
$(window).on("resize", function(event){
@@ -155,7 +156,10 @@
155156
object.css({
156157
'left': 0
157158
});
158-
}
159+
}
160+
161+
settings.resize.call(self, object);
162+
159163
}, 100);
160164

161165
});

0 commit comments

Comments
 (0)