Permalink
Browse files

Updated destroy event documentation

  • Loading branch information...
1 parent 771c4b5 commit d2cbc9a3d1185501fafbb10ec30cb9aba56d511d @nstanard nstanard committed Nov 28, 2016
Showing with 50 additions and 34 deletions.
  1. +9 −5 README.md
  2. +20 −14 index.html
  3. +21 −15 src/index.html
View
@@ -9,7 +9,7 @@ Please visit: [http://meandmax.github.io/lory/](http://meandmax.github.io/lory/
[![license](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://raw.githubusercontent.com/meandmax/lory/master/LICENSE)
[![npm](http://img.shields.io/npm/v/lory.js.svg?style=flat)](https://www.npmjs.com/package/lory.js)
-[![CDNJS](https://img.shields.io/cdnjs/v/lory.js.svg)](https://cdnjs.com/libraries/lory.js/)
+[![CDNJS](https://img.shields.io/cdnjs/v/lory.js.svg)](https://cdnjs.com/libraries/lory.js/)
[![build](http://img.shields.io/travis/meandmax/lory/master.svg?style=flat)](https://travis-ci.org/meandmax/lory)
[![code climate](http://img.shields.io/codeclimate/github/meandmax/lory.svg?style=flat)](https://codeclimate.com/github/meandmax/lory)
@@ -326,6 +326,14 @@ li {
<td>fires after slide change | <strong>arguments:</strong> currentSlide</td>
</tr>
<tr>
+ <td>before.lory.destroy</td>
+ <td>fires before the slider instance gets destroyed</td>
+ </tr>
+ <tr>
+ <td>after.lory.destroy</td>
+ <td>fires after the slider instance gets destroyed</td>
+ </tr>
+ <tr>
<td>on.lory.resize</td>
<td>fires on every resize event</td>
</tr>
@@ -341,10 +349,6 @@ li {
<td>on.lory.touchend</td>
<td>fires on every slider touchend event</td>
</tr>
- <tr>
- <td>on.lory.destroy</td>
- <td>fires when the slider instance gets destroyed</td>
- </tr>
</table>
## Getting Help
View
@@ -91,7 +91,7 @@
*/
width: 880px;
}
-
+
.prev, .next {
position: absolute;
top: 50%;
@@ -180,7 +180,7 @@
var dot_count = simple_dots.querySelectorAll('.js_slide').length;
var dot_container = simple_dots.querySelector('.js_dots');
var dot_list_item = document.createElement('li');
-
+
function handleDotEvent(e) {
if (e.type === 'before.lory.init') {
for (var i = 0, len = dot_count; i < len; i++) {
@@ -210,9 +210,9 @@
}
}
simple_dots.addEventListener('before.lory.init', handleDotEvent);
- simple_dots.addEventListener('after.lory.init', handleDotEvent);
- simple_dots.addEventListener('after.lory.slide', handleDotEvent);
- simple_dots.addEventListener('on.lory.resize', handleDotEvent);
+ simple_dots.addEventListener('after.lory.init', handleDotEvent);
+ simple_dots.addEventListener('after.lory.slide', handleDotEvent);
+ simple_dots.addEventListener('on.lory.resize', handleDotEvent);
var dot_navigation_slider = lory(simple_dots, {
infinite: 1,
@@ -489,12 +489,13 @@
events.addEventListener('after.lory.init', handleEvent);
events.addEventListener('before.lory.slide', handleEvent);
events.addEventListener('after.lory.slide', handleEvent);
+ events.addEventListener('before.lory.destroy', handleEvent);
+ events.addEventListener('after.lory.destroy', handleEvent);
events.addEventListener('on.lory.resize', handleEvent);
events.addEventListener('on.lory.touchend', handleEvent);
events.addEventListener('on.lory.touchmove', handleEvent);
events.addEventListener('on.lory.touchstart', handleEvent);
- events.addEventListener('on.lory.destroy', handleEvent);
lory(events, {
infinite: 1
@@ -747,6 +748,14 @@
<td>fires after slide change</td>
</tr>
<tr>
+ <th>before.lory.destroy</th>
+ <td>fires before the slider instance gets destroyed</td>
+ </tr>
+ <tr>
+ <th>after.lory.destroy</th>
+ <td>fires after the slider instance gets destroyed</td>
+ </tr>
+ <tr>
<th>on.lory.resize</th>
<td>fires on every resize event</td>
</tr>
@@ -762,10 +771,6 @@
<th>on.lory.touchend</th>
<td>fires on every slider touchend event</td>
</tr>
- <tr>
- <th>on.lory.destroy</th>
- <td>fires when the slider instance gets destroyed</td>
- </tr>
</table>
</section>
@@ -829,9 +834,9 @@
}
}
simple_dots.addEventListener('before.lory.init', handleDotEvent);
- simple_dots.addEventListener('after.lory.init', handleDotEvent);
- simple_dots.addEventListener('after.lory.slide', handleDotEvent);
- simple_dots.addEventListener('on.lory.resize', handleDotEvent);
+ simple_dots.addEventListener('after.lory.init', handleDotEvent);
+ simple_dots.addEventListener('after.lory.slide', handleDotEvent);
+ simple_dots.addEventListener('on.lory.resize', handleDotEvent);
var dot_navigation_slider = lory(simple_dots, {
infinite: 1,
@@ -885,12 +890,13 @@
events.addEventListener('after.lory.init', handleEvent);
events.addEventListener('before.lory.slide', handleEvent);
events.addEventListener('after.lory.slide', handleEvent);
+ events.addEventListener('before.lory.destroy', handleEvent);
+ events.addEventListener('after.lory.destroy', handleEvent);
events.addEventListener('on.lory.resize', handleEvent);
events.addEventListener('on.lory.touchend', handleEvent);
events.addEventListener('on.lory.touchmove', handleEvent);
events.addEventListener('on.lory.touchstart', handleEvent);
- events.addEventListener('on.lory.destroy', handleEvent);
lory(events, {
infinite: 1
View
@@ -91,7 +91,7 @@
*/
width: 880px;
}
-
+
.prev, .next {
position: absolute;
top: 50%;
@@ -248,7 +248,7 @@
var dot_count = simple_dots.querySelectorAll('.js_slide').length;
var dot_container = simple_dots.querySelector('.js_dots');
var dot_list_item = document.createElement('li');
-
+
function handleDotEvent(e) {
if (e.type === 'before.lory.init') {
for (var i = 0, len = dot_count; i < len; i++) {
@@ -278,9 +278,9 @@
}
}
simple_dots.addEventListener('before.lory.init', handleDotEvent);
- simple_dots.addEventListener('after.lory.init', handleDotEvent);
- simple_dots.addEventListener('after.lory.slide', handleDotEvent);
- simple_dots.addEventListener('on.lory.resize', handleDotEvent);
+ simple_dots.addEventListener('after.lory.init', handleDotEvent);
+ simple_dots.addEventListener('after.lory.slide', handleDotEvent);
+ simple_dots.addEventListener('on.lory.resize', handleDotEvent);
var dot_navigation_slider = lory(simple_dots, {
infinite: 1,
@@ -489,12 +489,13 @@
events.addEventListener('after.lory.init', handleEvent);
events.addEventListener('before.lory.slide', handleEvent);
events.addEventListener('after.lory.slide', handleEvent);
+ events.addEventListener('before.lory.destroy', handleEvent);
+ events.addEventListener('after.lory.destroy', handleEvent);
events.addEventListener('on.lory.resize', handleEvent);
events.addEventListener('on.lory.touchend', handleEvent);
events.addEventListener('on.lory.touchmove', handleEvent);
events.addEventListener('on.lory.touchstart', handleEvent);
- events.addEventListener('on.lory.destroy', handleEvent);
lory(events, {
infinite: 1
@@ -747,6 +748,14 @@
<td>fires after slide change</td>
</tr>
<tr>
+ <th>before.lory.destroy</th>
+ <td>fires before the slider instance gets destroyed</td>
+ </tr>
+ <tr>
+ <th>after.lory.destroy</th>
+ <td>fires after the slider instance gets destroyed</td>
+ </tr>
+ <tr>
<th>on.lory.resize</th>
<td>fires on every resize event</td>
</tr>
@@ -762,10 +771,6 @@
<th>on.lory.touchend</th>
<td>fires on every slider touchend event</td>
</tr>
- <tr>
- <th>on.lory.destroy</th>
- <td>fires when the slider instance gets destroyed</td>
- </tr>
</table>
</section>
@@ -799,7 +804,7 @@
infinite: 1,
enableMouseEvents: true
});
-
+
function handleDotEvent(e) {
if (e.type === 'before.lory.init') {
for (var i = 0, len = dot_count; i < len; i++) {
@@ -829,9 +834,9 @@
}
}
simple_dots.addEventListener('before.lory.init', handleDotEvent);
- simple_dots.addEventListener('after.lory.init', handleDotEvent);
- simple_dots.addEventListener('after.lory.slide', handleDotEvent);
- simple_dots.addEventListener('on.lory.resize', handleDotEvent);
+ simple_dots.addEventListener('after.lory.init', handleDotEvent);
+ simple_dots.addEventListener('after.lory.slide', handleDotEvent);
+ simple_dots.addEventListener('on.lory.resize', handleDotEvent);
var dot_navigation_slider = lory(simple_dots, {
infinite: 1,
@@ -885,12 +890,13 @@
events.addEventListener('after.lory.init', handleEvent);
events.addEventListener('before.lory.slide', handleEvent);
events.addEventListener('after.lory.slide', handleEvent);
+ events.addEventListener('before.lory.destroy', handleEvent);
+ events.addEventListener('after.lory.destroy', handleEvent);
events.addEventListener('on.lory.resize', handleEvent);
events.addEventListener('on.lory.touchend', handleEvent);
events.addEventListener('on.lory.touchmove', handleEvent);
events.addEventListener('on.lory.touchstart', handleEvent);
- events.addEventListener('on.lory.destroy', handleEvent);
lory(events, {
infinite: 1

0 comments on commit d2cbc9a

Please sign in to comment.