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

responsive #51

Open
hbhasin3 opened this issue Sep 1, 2016 · 6 comments
Open

responsive #51

hbhasin3 opened this issue Sep 1, 2016 · 6 comments

Comments

@hbhasin3
Copy link

hbhasin3 commented Sep 1, 2016

the swiper is not responsive.
help me out making its responsive for mobie view
thank you

@brh55
Copy link
Contributor

brh55 commented Sep 1, 2016

Hi there @hbhasin3 ,

Use the breakpoints param (http://idangero.us/swiper/api/#.V8hq_5MrI_U)

Ie: For mobile (TIP: it's best practice to refer it as screen sizes (small,medium,etc)) , you would want to set up a breakpoint. Take a look at http://mydevice.io/devices/ to try to gauge and target particular devices.

  breakpoints: {
    // when window width is <= 320px
    320: {
      slidesPerView: 1,
      spaceBetweenSlides: 10
    },
    // when window width is <= 480px
    480: {
      slidesPerView: 2,
      spaceBetweenSlides: 20
    },
    // when window width is <= 640px
    640: {
      slidesPerView: 3,
      spaceBetweenSlides: 30
    }

Now pass in that object like so with the override-parameters attribute, it should work for you.

<ks-swiper-container override-parameters="{ 'breakpoints': { '320': { 'slidesPerView': '1' }}}">
    <ks-swiper-slide class="swiper-slide" ng-repeat="s in [1,2,3,4,5,6,7,8,9,10,11,12,13,14]">
      <img ng-src="http://api.randomuser.me/portraits/thumb/men/{{s}}.jpg">
    </ks-swiper-slide>
</ks-swiper-container>

@hbhasin3
Copy link
Author

hbhasin3 commented Sep 5, 2016

sorry for disturbing you again but mine is not working
please provide me a small working example in angular
thank you

@hbhasin3
Copy link
Author

hbhasin3 commented Sep 5, 2016

if am taking override-parameters="{'effect':'cube'}" then it i taking those parameters and effect is show of the same but when i pass breakpoints then the effects are not shown for the same

@hbhasin3
Copy link
Author

hbhasin3 commented Sep 5, 2016

issue resolved thank you 👍

@brh55
Copy link
Contributor

brh55 commented Nov 16, 2016

@ksachdeva Close issue when u get a chance.

@ghost
Copy link

ghost commented May 12, 2017

I tried everything and breakpoints definitely didn't work until i increased the version of swiper dependency to ~3.2.0. Think it's time for increasing the supported version of swiper dependency.

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

2 participants