Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • 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. General Discussion
  3. website Image background scaling wrong only on iOS

website Image background scaling wrong only on iOS

Scheduled Pinned Locked Moved General Discussion
3 Posts 2 Posters 325 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.
  • P Offline
    P Offline
    paulh
    wrote on last edited by
    #1

    Hey everybody,

    I'm not sure if this is a bug or if I did something wrong. I set an Image as a custom static Background for the Mobile version of the Site. It looks perfect on android but is zoomed in weirdly on iOS. This is happening browser independent on iOS, so Safari, Firefox etc. all show it wrong, while every browser on Android seems to be working fine. iPhone Emulations on Desktop also show the background as it should be. I do have different Images set for Desktop and Mobile in horizontal and vertical respectively. Not sure if that might be causing it. All Plugins except for Custom Fonts, Lay Carousel and Lay Lightbox are already disabled.

    Here's the link to a page on the website and there are screenshots below:
    https://dieadlerwirtschaft.de/background-2/

    I hope this has not already been addressed here, I certainly was not able to find anything similar on the Forum. Any help would be greatly appreciated.

    Screenshot_android.jpg Screenshot_ios.jpg

    1 Reply Last reply
    0
    • arminunruhA Offline
      arminunruhA Offline
      arminunruh
      Global Moderator
      wrote on last edited by
      #2

      iOS doesnt support "background-attachment: fixed;"
      (you can google it, its a performance thing thats why they disabled it)

      thats why the background image spans 100% of the height of the page and gets scaled and thus the background scrolls, when you scroll the page.

      html.is-ios #custom-phone-grid,
      html.is-ios .cover-region-phone .cover-inner,
      html.is-ios #grid,
      html.is-ios .cover-region-desktop .cover-inner{
              background-size: contain!important;
              background-attachment: scroll!important;
              background-repeat: repeat!important;
              background-position: unset!important;
      }
      

      This will make your background on iOS a scrollable background and that repeats itself. Instead of scaling to 100% of the page height.

      For this you will need a pattern that can actually repeat.

      If you know your way around html and css,
      another way could be this:

      in lay options custom css/html:

      create a "background html container" that has a height of 100lvh and width auf 100%;
      then use a background image for it
      use css to use position: fixed;
      use css to set any grid's background colors to transparent.
      use css to place that container behind all of your content

      i think i dont have time to do that custom code for you at the moment

      1 Reply Last reply
      0
      • P Offline
        P Offline
        paulh
        wrote on last edited by
        #3

        Thank you!
        At least I didn't screw anything up. I'll try the css way and if that doesn't work I can use the loop as a fallback. And thanks again for the fast answer

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        I also code custom websites or custom Lay features.
        šŸ’æ Email me here: šŸ’æ
        info@laytheme.com

        Before you post:
        1. When using a WordPress Cache plugin, disable it or clear your cache.
        2. Update Lay Theme and all Lay Theme Addons
        3. Disable all Plugins
        4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

        This often solves issues you might run into

        When you post:
        1. Post a link to where the problem is
        2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
        3. If the problem is difficult to explain, post screenshots / link to a video to explain it
        Online Users
        C
        craigfeldspar
        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