Coder Social home page Coder Social logo

responsive about angular-swiper HOT 6 OPEN

ksachdeva avatar ksachdeva commented on June 15, 2024
responsive

from angular-swiper.

Comments (6)

brh55 avatar brh55 commented on June 15, 2024

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>

from angular-swiper.

hbhasin3 avatar hbhasin3 commented on June 15, 2024

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

from angular-swiper.

hbhasin3 avatar hbhasin3 commented on June 15, 2024

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

from angular-swiper.

hbhasin3 avatar hbhasin3 commented on June 15, 2024

issue resolved thank you 👍

from angular-swiper.

brh55 avatar brh55 commented on June 15, 2024

@ksachdeva Close issue when u get a chance.

from angular-swiper.

 avatar commented on June 15, 2024

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.

from angular-swiper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.