Created
July 28, 2019 23:32
-
-
Save Haguilar91/7ffa43bf2faee3f9f13a8850b49781c4 to your computer and use it in GitHub Desktop.
Ayuda con Turbolinks slider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$('#star').raty(); | |
$('.star-rating').raty({ | |
path: '/images/black', | |
readOnly: true, | |
score: function() { | |
return $(this).attr('data-score'); | |
} | |
}); | |
</script> | |
<script> | |
const mySiema = new Siema({ | |
selector: '.siema', | |
duration: 200, | |
easing: 'ease-out', | |
perPage: 1, | |
loop: true, | |
startIndex: 0, | |
draggable: true, | |
multipleDrag: true, | |
threshold: 20, | |
onInit: () => {}, | |
onChange: () => {}, | |
////Aplicando lo que me comentas//////////////// | |
}); | |
$(document).on('turbolinks:render', function () { | |
mySiema() | |
}) | |
$(document).on('turbolinks:load', function () { | |
mySiema() | |
}) | |
$(document).ready(function () { | |
mySiema() | |
}) | |
/////////////////////////////////////// | |
setInterval(() => mySiema.next(), 2000) | |
document.querySelector('.prev').addEventListener('click', () => mySiema.prev()); | |
document.querySelector('.next').addEventListener('click', () => mySiema.next()); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment