Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Carousel | Slides with individual object-fit

    Addons
    2
    6
    52
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mp last edited by mp

      Hi there,

      is it possible to adjust the object-fit of individual slides?

      I know how there is a way to customize the individual background-color with this:

      .lay-carousel-slide:nth-child(4) {
          background-color: #000;
      }
      

      But is there a way to adjust the object-fit like this? Would be great if it then would also apply to only a specific carousel ...

      Thanks!

      1 Reply Last reply Reply Quote 0
      • mariusjopen
        mariusjopen Global Moderator last edited by

        Dear @mp
        yes. You could use this. Then you need to address the element within.
        Can you post a link to your website?
        We will then have a look and inspect that!
        Many wishes!
        Marius

        www.mariusjopen.world

        1 Reply Last reply Reply Quote 0
        • M
          mp last edited by

          hey, thanks for the answer.

          ... well the website right now is this: http://runningwater.eu, but there is not much to see, except a slightly modified carousel (it never is higher than its width – for mobile).

          the use case would be for images that have a centered area of interest vs. images that are easily cropped. so for example a book spread vs. an installation view. the book spread would need to be centered and preferably never cropped (object-fit: contain;) and the installation view could be cropped and should fill the frame (object-fit: cover;).

          an amazing additional idea would be to add a background image to the images that are contained. This way the slide could be a png with a transparent portion that is always completely visible, with a background-image that is ‘cut‘ to size – this would be a killer feature for portfolio oriented carousels.

          thanks so much, laytheme has really been a lifesaver on tons of projects. :-*

          1 Reply Last reply Reply Quote 0
          • mariusjopen
            mariusjopen Global Moderator last edited by

            Dear @mp
            thank you for using LayTheme!

            Yes, The transparent background image could be an idea!
            Best!
            Marius

            www.mariusjopen.world

            1 Reply Last reply Reply Quote 0
            • M
              mp last edited by mp

              Dear @mariusjopen

              thank you – do you maybe have a pointer for my original question? that would be awesome!

              1 Reply Last reply Reply Quote 0
              • mariusjopen
                mariusjopen Global Moderator last edited by

                Dear @mp

                .lay-carousel-slide:nth-child(4) img {
                         object-fit: contain !important;
                }
                

                I was not able to test it , but something like this should work.
                Best!
                Marius

                www.mariusjopen.world

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Post a link to where the problem is if possible, please <3
                I don't answer or check forum DMs, please just post on the forum.
                Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com

                Before you post:

                Use the Search Feature. Maybe there is already a solution to your issue.

                1. Update Lay Theme and all Lay Theme Addons
                2. Disable all Plugins
                3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
                4. When using a WordPress Cache plugin, disable it or clear your cache. Now see if your problem solved itself.
                Go here, see if your problem is listed here:
                Troubleshooting

                When you post:
                1. Post a link to where the problem is
                2. If the problem is difficult to explain, post screenshots / link to a video to explain it

                Thanks!

                Online Users

                Recent Topics

                • Website gone all blank after update 6.3.1

                • A

                  sit carousel captions at bottom of page

                • A

                  carousel addon is blank on the front page

                • menu doesn't show on latest update 6.3.1

                laytheme.com