These are chat archives for idiot/unslider

13th
Dec 2015
zengtronic
@zengtronic
Dec 13 2015 17:30

I have own buttons in my Slides which replace the original Buttons for next & previous, but it won't work properly. I think my slider get's reinitialized with each click like you see in this screenshot: http://src.zengtronic-labs.de/unslider.PNG .

The Code:

<script src="src/unslider/js/unslider-min.js"></script>
<script>
jQuery(document).ready(function($) {
$('.tut-slider').unslider({ arrows: false});
});
$('.slidenext').click(function(){$('.tut-slider').unslider('Next')});
$('.slideprev').click(function(){$('.tut-slider').unslider('Prev')});

</script>

I don't know why but if I use e.g. $('.manual-slider').unslider('Prev') in the Console on your demopage, it slides to the next slide, on my page, it reinitialize the slider o.O
Have you any solution for this or an idea why it behaves like this?

greetins steve (and sorry for my bad english ^^)

Charlotte Swift
@idiot
Dec 13 2015 17:31
{ arrows: { next: '<a class="slidenext" />, prev: '<a class="slideprev" />'} }
don't need to do manual click handlers
so
jQuery(document).ready(function($) {
$('.tut-slider').unslider({ arrows: {prev: '<a class="slideprev" />', next: '<a class="slidenext" />' });
});
or
jQuery(document).ready(function($) {
var slider = $('.tut-slider').unslider({ arrows: false});

$('.slidenext').click(function(){ slider.unslider('next') });
$('.slideprev').click(function(){ slider.unslider('prev') });
});
zengtronic
@zengtronic
Dec 13 2015 17:46
thanks it works ;) But one little thing: how can i set the text on the "solution 1"? { arrows: { next: '<a class="slidenext" />Vorwärts</a>, prev: '<a class="slideprev" />Zurück</a>'} } only shows blank buttons without the text (i tried it with and without </a>)
Charlotte Swift
@idiot
Dec 13 2015 18:31
'<a class="slideprev">Zurück</a>', you're closing the HTML too early
zengtronic
@zengtronic
Dec 13 2015 18:52
oh... now it works perfectly. Thx (y) :D