Lay Theme Forum

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

    image heights and scaling on mobile

    General Discussion
    2
    4
    18
    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
      Monamos last edited by

      Hi guys. I am trying to work out a way to set rules for how images will get vertically scaled up on mobile. I have a site with lots of landscape format images. However on mobile these end up looking like quite small thumbnails. I'd like to be able to scale the vertical heights of these (cropping the sides is ok), so they fill up more of the mobile browser.

      Is there a best practice approach for this using Lay?

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

        i see

        at the moments its probably best to create a custom phone layout and put in portrait images,

        if you're good with css, maybe you can use
        https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit
        and
        maybe https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio

        and probably the padding-bottom .ph div inside of an image element. you probably need to adapt it with css too

        M 1 Reply Last reply Reply Quote 0
        • M
          Monamos @arminunruh last edited by

          Thanks @arminunruh I've worked around a little hack which sort of solves it. For images that I want to scale vertically on mobile, I have added them as row background images, and then given the row a height like 100vh. This then scaled it right up on mobile and crops the side. The only caveat being I need to make sure those images can scale gracefully and not lose important details in the crop.

          Do you see any problem with using viewport heights and row background images on different browser versions or devices?

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

            no, i think its a clever solution!

            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

            O

            Recent Topics

            • Search as icon instead of text?

            • FILTER Categories showing all projects

            • H

              Vimeo embed with autoplay and loop is really slow...help!

            • A

              website not loading on iphone safari

            laytheme.com