Skip to content

Commit

Permalink
v1.1.6 Change autoplay function
Browse files Browse the repository at this point in the history
  • Loading branch information
ma-5 committed Sep 16, 2017
1 parent a650fa5 commit b7cca4d
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 15 deletions.
20 changes: 19 additions & 1 deletion app/js/ma5slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*!
* MA5-Slider
* v 1.1.5
* v 1.1.6
* MIT License
* Copyright (c) 2016 Tomasz Kalinowski
* http://ma5slider.ma5.pl
Expand Down Expand Up @@ -241,6 +241,14 @@ $.widget("ma5.ma5slider", {
this.goToSlide(parm.slideCount);
}
},
updateCanvas: function () {
var elm = this.element;
var parm = this._parm();
var activeImage = elm.find('.slide--active img');
var newWidth = activeImage.width();
var newHeight = activeImage.height();
elm.find('.canvas').attr('width', newWidth).attr('height', newHeight);
},
// private methods.
_parm: function () {
var elm = this.element;
Expand Down Expand Up @@ -431,6 +439,13 @@ $.widget("ma5.ma5slider", {
}
widgetThis.goToSlide(counter);
}, tempo);
$("body").keydown(function (e) {
if (e.keyCode == 9) {
clearInterval(autoplay);
return true;
}
});

elm.on('touch click', function () {
clearInterval(autoplay);
return true;
Expand Down Expand Up @@ -662,6 +677,9 @@ $(document).ready(function () {
// Refresh for responsive
$(window).resize(function () {
$('.ma5slider').ma5slider('goToSlide', 'current');
setTimeout(function () {
$('.ma5slider').ma5slider('updateCanvas');
}, 500);
});

// External control extension
Expand Down
2 changes: 1 addition & 1 deletion app/scss/ma5slider.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* MA5-Slider
* v 1.1.5
* v 1.1.6
* MIT License
* Copyright (c) 2016 Tomasz Kalinowski
* http://ma5slider.ma5.pl
Expand Down
2 changes: 1 addition & 1 deletion dist/css/ma5slider.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/ma5slider.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/index-autoplay.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<h1><a href="http://ma5slider.ma5.pl">MA5Slider <span class="sr-only">- jQuery Image Slider</span></a></h1>
<p class="description">Image slider</p>
<p class="description">Ease to use, lightweight, responsive, mouse draggable, customizable by CSS classes, custom animations for each slide, JS methods and events. Javascript 16kB</p>
<p><a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.5</p>
<p><a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.6</p>
</div>
</div>
</header>
Expand Down Expand Up @@ -92,7 +92,7 @@ <h4><span class="parameter">autoplay</span> auto play slider</h4>
</div>
<footer class="site-footer container">
<hr>
MA5 Slider has MIT License, <a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.5
MA5 Slider has MIT License, <a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.6
</footer>
</body>
</html>
4 changes: 2 additions & 2 deletions dist/index-docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<h1><a href="http://ma5slider.ma5.pl">MA5Slider <span class="sr-only">- jQuery Image Slider</span></a></h1>
<p class="description">Image slider</p>
<p class="description">Ease to use, lightweight, responsive, mouse draggable, customizable by CSS classes, custom animations for each slide, JS methods and events. Javascript 16kB</p>
<p><a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.5</p>
<p><a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.6</p>
</div>
</div>
</header>
Expand Down Expand Up @@ -526,7 +526,7 @@ <h2>Autoplay module</h2>
</div>
<footer class="site-footer container">
<hr>
MA5 Slider has MIT License, <a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.5
MA5 Slider has MIT License, <a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.6
</footer>
</body>
</html>
4 changes: 2 additions & 2 deletions dist/index-examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<h1><a href="http://ma5slider.ma5.pl">MA5Slider <span class="sr-only">- jQuery Image Slider</span></a></h1>
<p class="description">Image slider</p>
<p class="description">Ease to use, lightweight, responsive, mouse draggable, customizable by CSS classes, custom animations for each slide, JS methods and events. Javascript 16kB</p>
<p><a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.5</p>
<p><a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.6</p>
</div>
</div>
</header>
Expand Down Expand Up @@ -652,7 +652,7 @@ <h2>Autoplay module</h2>
</div>
<footer class="site-footer container">
<hr>
MA5 Slider has MIT License, <a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.5
MA5 Slider has MIT License, <a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.6
</footer>
</body>
</html>
6 changes: 3 additions & 3 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<!-- MA5 Slider-->
<link href="./css/ma5slider.min.css" rel="stylesheet" type="text/css">
<script src="./js/ma5slider.min.js"></script>
<script src="./js/ma5slider.js"></script>

<script>
$(window).on('load', function () {
Expand All @@ -44,7 +44,7 @@
<h1><a href="http://ma5slider.ma5.pl">MA5Slider <span class="sr-only">- jQuery Image Slider</span></a></h1>
<p class="description">Image slider</p>
<p class="description">Ease to use, lightweight, responsive, mouse draggable, customizable by CSS classes, custom animations for each slide, JS methods and events. Javascript 16kB</p>
<p><a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.5</p>
<p><a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.6</p>
</div>
</div>
</header>
Expand Down Expand Up @@ -116,7 +116,7 @@ <h2>Quick start</h2>
</div>
<footer class="site-footer container">
<hr>
MA5 Slider has MIT License, <a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.5
MA5 Slider has MIT License, <a href="https://github.com/ma-5/ma5slider" target="_blank">Github</a> v 1.1.6
</footer>
</body>
</html>
Loading

0 comments on commit b7cca4d

Please sign in to comment.