WordPress.org

Forums

Meta Slider
[resolved] Carousel slider problem (9 posts)

  1. AndCas
    Member
    Posted 2 years ago #

    First of all thanks for the plugin! I really like it!
    I have just one problem with this (probably caused by me during the slider customization): I'm using a carousel slider to show some images, with 4 picture for screen, but when i scroll the slider to see the next images series, the first and the last images go middle out from the slider and these seems like cutted.

    I tryed to see with firebug and seem that the problem is in the margin-left of the ul (that allows the scroll of the carousel) that changes just of 610px instead of 960px (that's the width of my gallery).

    So, there is a way to customize this value?

    Thank's in advance for your help! :)

    P.S. Now I'm working on XAMPP so i can't link the site, but i post some screenshot to be more comprensible! Screen1 Screen2

    http://wordpress.org/extend/plugins/ml-slider/

  2. AndCas
    Member
    Posted 2 years ago #

  3. Matcha Labs
    Member
    Plugin Author

    Posted 2 years ago #

    Hi AndCas,

    I think its because you've added borders to the images. FlexSlider will calculate how many pixels to shift the carousel across based on each images width, plus a 5px margin between each image (hard coded at the moment). If you add borders or force the margin to be something other than 5px, then the calculation will be incorrect as the extra borders and margin would not be accounted for.

    Regards,
    Tom.

  4. AndCas
    Member
    Posted 2 years ago #

    Thank's very much for your reply! Now i fixed the problem! :)

  5. Matcha Labs
    Member
    Plugin Author

    Posted 2 years ago #

    You're welcome!

    I've just added a hook into 2.1.6 to adjust the margin between slides (but it won't handle borders still). Add this to your functions.php file if you need to adjust the margin:

    function metaslider_carousel_margin($margin, $slider_id) {
        return 50; // value in pixels
    }
    add_filter('metaslider_carousel_margin', 'metaslider_carousel_margin', 10, 2);

    Regards
    Tom

  6. darrin365
    Member
    Posted 1 year ago #

    This is very helpful, but is it possible to use this to define different margins between different sliders. For instance, 70px between images in slider ID 26, but 5px between images in slider 126?

  7. Matcha Labs
    Member
    Plugin Author

    Posted 1 year ago #

    Yep:

    function metaslider_carousel_margin($margin, $slider_id) {
        if ($slider_id == 26) {
            return 70;
        }
    
        if ($slider_id == 126) {
            return 5;
        }
    
         return 20; // all other sliders
    }
    add_filter('metaslider_carousel_margin', 'metaslider_carousel_margin', 10, 2);
  8. darrin365
    Member
    Posted 1 year ago #

    Matcha Labs,

    You are my hero. Thanks!

  9. jbrew30
    Member
    Posted 1 year ago #

    Is it possible for the carousel to scroll only 2 images at a time?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Meta Slider
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic