Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Addons
  3. Carousel | Slides with individual object-fit

Carousel | Slides with individual object-fit

Scheduled Pinned Locked Moved Addons
6 Posts 2 Posters 1.0k Views
  • 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
    M
    mp
    wrote on last edited by mp
    #1

    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
    0
    • mariusjopenM
      mariusjopenM
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      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
      0
      • M
        M
        mp
        wrote on last edited by
        #3

        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
        0
        • mariusjopenM
          mariusjopenM
          mariusjopen
          Global Moderator
          wrote on last edited by
          #4

          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
          0
          • M
            M
            mp
            wrote on last edited by mp
            #5

            Dear @mariusjopen

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

            1 Reply Last reply
            0
            • mariusjopenM
              mariusjopenM
              mariusjopen
              Global Moderator
              wrote on last edited by
              #6

              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
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              Online Users
              I
              itsbadjujuju
              Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
              laytheme.com
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Recent
              • Tags
              • Popular
              • Users
              • Search