Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need suggestion #310

Open
matpag opened this issue Jan 11, 2014 · 0 comments
Open

Need suggestion #310

matpag opened this issue Jan 11, 2014 · 0 comments

Comments

@matpag
Copy link

matpag commented Jan 11, 2014

i want set more iosslider in the same page, now if i want more slider i have to add this piece of code for have 2 slider, but i will need 20 slider in the same page so you can imagine the stupidity on writing the same code for 20 times

$(document).ready(function() {

             $('.iosSlider-1').iosSlider({
                scrollbar: true,
                snapToChildren: true,
                desktopClickDrag: true,
                scrollbarMargin: '5px 40px 0 40px',
                scrollbarBorderRadius: 0,
                scrollbarHeight: '2px',
                navPrevSelector: $('.prevButtonslide-1'),
                navNextSelector: $('.nextButtonslide-1')
            });

            $('.iosSlider-2').iosSlider({
                scrollbar: true,
                snapToChildren: true,
                desktopClickDrag: true,
                scrollbarMargin: '5px 40px 0 40px',
                scrollbarBorderRadius: 0,
                scrollbarHeight: '2px',
                navPrevSelector: $('.prevButtonslide-2'),
                navNextSelector: $('.nextButtonslide-2')
            });

                /*.......*/

});

it's very annoying, there isn't a solution for cycle all the elements?

i've tried these code below but dosn't work, i'm starting now with jquery so i'm sure i'm making something wrong

           var x;
           for (x = 1; x = numberOfSlidersInPage; x++) {

            $("[class^=iosSlider-"+ x +"]").iosSlider({
                scrollbar: true,
                snapToChildren: true,
                desktopClickDrag: true,
                scrollbarMargin: '5px 40px 0 40px',
                scrollbarBorderRadius: 0,
                scrollbarHeight: '2px',
                navPrevSelector: $("[class^=prevButtonslide-"+ x +"]"),
                navNextSelector: $("[class^=nextButtonslide-"+ x +"]")
                });

            }

Thanks for Help ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant