kopipejst/coin-slider

Possibility to translate or change the text for buttons "prev" and "next"

Closed this issue · 4 comments

Thanks

You are Lionel Messi ? Hehe.

Lines 199-200 in the coin-slider.js file :

$('#cs-navigation-' + el.id).append("<a href='#' id='cs-prev-" + el.id + "' class='cs-prev'>prev</a>");
$('#cs-navigation-' + el.id).append("<a href='#' id='cs-next-" + el.id + "' class='cs-next'>next</a>");

For example, translated to Spanish :

$('#cs-navigation-' + el.id).append("<a href='#' id='cs-prev-" + el.id + "' class='cs-prev'>anterior</a>");
$('#cs-navigation-' + el.id).append("<a href='#' id='cs-next-" + el.id + "' class='cs-next'>próximo</a>");

Hi,

Thank you for your answer but I need to have two options. For example "prevText" and "nextText".

I tried to change the code but I'm not sure if it's correct. But it works...

Line 199

$('#cs-navigation-' + el.id).append("<a href='#' id='cs-prev-" + el.id + "' class='cs-prev'>"+params[el.id].prevText+"</a>");
$('#cs-navigation-' + el.id).append("<a href='#' id='cs-next-" + el.id + "' class='cs-next'>"+params[el.id].nextText+"</a>");

Line 503

// default values
    $.fn.coinslider.defaults = {
        width: 565, // width of slider panel
        height: 290, // height of slider panel
        spw: 7, // squares per width
        sph: 5, // squares per height
        delay: 3000, // delay between images in ms
        sDelay: 30, // delay beetwen squares in ms
        opacity: 0.7, // opacity of title and navigation
        titleSpeed: 500, // speed of title appereance in ms
        effect: '', // random, swirl, rain, straight
        navigation: true, // prev next and buttons
        links : true, // show images as links
        hoverPause: true, // pause on hover
        prevText: 'prev',
        nextText: 'next'
    };

HTML side :

<script>
    $('#games').coinslider({
        prevText: 'anterior',
        nextText: 'próximo'
    });
</script>

That code is fine, you can send me pull request so I'll add that change to trunk.

Thanks

I close this issue.