Announcement

Collapse
No announcement yet.

Slick Slider Modification

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Slick Slider Modification

    We would like the thumbnails to all be the same 'width' on desktop and same 'height' on mobile but we have vertical and horizontal thumbnails. The thumbnails are correct on desktop (not mobile) based on how we set dimensions in admin for the thumbnails. But it seems maybe imagemachine is placing heights on the divs around the thumbnails causing huge spaces between thumbs. https://dts2290.mivamerchantdev.com/southern-magnolia-memorial-tree.

    Is there a way to get this to just have equal spacing between each thumb for desktop and mobile?

    #2
    Unfortunately, Slick has some issues when it comes to vertical carousels with images of different heights. There are several suggestions on how to remedy this, but none have been implemented yet. If you are feeling adventurouse, you could try some of the suggestions in this thread and request:
    Matt Zimmermann

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment


      #3
      Thanks for the tip. I tried implementing the one fix below but it didn't change anything unfortunately.

      Code:
      if (_.options.vertical === false) { targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset; } else { verticalOffset = 0; for (let i = 0; i < slideIndex; i++) { verticalOffset += _.$slides.eq(i).outerHeight(true); } if (_.options.infinite === true) { Array.from(_.$slideTrack[0].children).forEach((slide) => { if (slide.dataset.slickIndex < 0) { verticalOffset += $(slide).outerHeight(true); } }); } targetLeft = verticalOffset * -1; }
      Last edited by afiumano; 07-23-19, 10:25 AM.

      Comment


        #4
        I know Slick has issues with vertical carousels but am wondering if the attached screen shot is part of this glitch or something else. There is a huge amount of space between the thumbnails.

        Comment


          #5
          That looks like it is being caused by the calculations to make the image areas equal. Do you have an image that is quite a bit taller than the rest?
          Matt Zimmermann

          Miva Web Developer
          Alchemy Web Development
          https://www.alchemywebdev.com
          Site Development - Maintenance - Consultation

          Miva Certified Developer
          Miva Professional Developer

          https://www.dev4web.net | Twitter

          Comment


            #6
            Vertical image as shown in screen shot is 320x480. Horizontal images are 480x319. So the image in the screen shot would be the tallest.

            Comment


              #7
              That is where the space is coming from. The code is making all the thumbnail regions the same width and height as the largest of them.
              Matt Zimmermann

              Miva Web Developer
              Alchemy Web Development
              https://www.alchemywebdev.com
              Site Development - Maintenance - Consultation

              Miva Certified Developer
              Miva Professional Developer

              https://www.dev4web.net | Twitter

              Comment

              Working...
              X