Skip to content

Instantly share code, notes, and snippets.

@Haguilar91
Created July 28, 2019 23:32
Show Gist options
  • Save Haguilar91/7ffa43bf2faee3f9f13a8850b49781c4 to your computer and use it in GitHub Desktop.
Save Haguilar91/7ffa43bf2faee3f9f13a8850b49781c4 to your computer and use it in GitHub Desktop.
Ayuda con Turbolinks slider
<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