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. Bug Reports
  3. Lazy Load Images / Image Placeholder Background Color stays behind transparent PNGs

Lazy Load Images / Image Placeholder Background Color stays behind transparent PNGs

Scheduled Pinned Locked Moved Bug Reports
12 Posts 3 Posters 2.8k Views 3 Watching
  • 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.
  • mariusjopenM
    mariusjopenM
    mariusjopen
    Global Moderator
    wrote on last edited by
    #2

    Dear @edgrbnz

    can you provide a link to your website that we can see what you mean?

    Thank you!

    Mariu

    www.mariusjopen.world

    1 Reply Last reply
    0
    • edgrbnzE
      edgrbnzE
      edgrbnz
      wrote on last edited by
      #3

      I sent you a link and password to have a look. Beware,… it’s all very work-in-progress by now.

      ✦ ✦ ✦

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

        Dear @edgrbnz
        the password does not work.

        Best!

        Marius

        www.mariusjopen.world

        edgrbnzE 1 Reply Last reply
        0
        • mariusjopenM mariusjopen

          Dear @edgrbnz
          the password does not work.

          Best!

          Marius

          edgrbnzE
          edgrbnzE
          edgrbnz
          wrote on last edited by edgrbnz
          #5

          @mariusjopen I sent the correct one,… sorry.

          Just to make sure:
          the red backgrounds shouldn‘t be there. It’s just a random color I chose to make the above mentioned behaviour visibile.

          For my understanding it would be logical to hide the placeholder background color of the lazy load images as soon as the images have loaded.
          I could choose to have no placeholder background color for lazy load images which causes a bit of a usability issue since the user doesn’t know if there are images being loaded or the page is just blank.

          ✦ ✦ ✦

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

            Dear @edgrbnz
            I am checking with Armin.

            Will let you know soon.

            Best!

            Marius

            www.mariusjopen.world

            1 Reply Last reply
            0
            • edgrbnzE
              edgrbnzE
              edgrbnz
              wrote on last edited by
              #7

              Thank you!

              ✦ ✦ ✦

              1 Reply Last reply
              0
              • edgrbnzE
                edgrbnzE
                edgrbnz
                wrote on last edited by
                #8

                Just wee little bump, to check if there are any news regarding this.

                ✦ ✦ ✦

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

                  Hey one easy solution would be to not use a png
                  or set the Image Placeholder Background Color back to transparent

                  there is no easy way to make the placeholder color disappear when ur image has loaded

                  take a look at https://github.com/aFarkas/lazysizes
                  lazysizes has some javascript events like "lazyloaded" that fire when an image has loaded.

                  Add this to "lay options" -> "custom <head> content":

                  <script>
                  jQuery(document).on('lazyloaded', function(e){
                      if( jQuery(e.target.parentNode).hasClass('img') ){
                          jQuery(e.target).next('.ph').css('background-color', 'transparent');
                      }
                  });
                  </script>
                  
                  1 Reply Last reply
                  0
                  • edgrbnzE
                    edgrbnzE
                    edgrbnz
                    wrote on last edited by
                    #10

                    @arminunruh Thank you!
                    The code works fine! Is there any way to ease-out the transition to transparent?

                    Hey one easy solution would be to not use a png

                    True!
                    But I wanted to prevent that (font-based) images look blury because of jpeg-compression and also wanted the background color of given images to appear in the same shade as the page background. (which is sometimes not controllable dependig on color renderung and image profiles)

                    ✦ ✦ ✦

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

                      Dear @edgrbnz

                      add this to your custom CSS:

                      .ph { transition: 0.2s ease; }
                      

                      Let me know if that worked well.

                      Best!

                      Marius

                      www.mariusjopen.world

                      1 Reply Last reply
                      0
                      • edgrbnzE
                        edgrbnzE
                        edgrbnz
                        wrote on last edited by edgrbnz
                        #12

                        @mariusjopen said in Lazy Load Images / Image Placeholder Background Color stays behind transparent PNGs:

                        .ph { transition: 0.2s ease; }

                        It kinda works. On some images (gifs) the background just stays behind the images. I think I'll stick with load images instantly. And try to keep the file sizes to a minimum.

                        ✦ ✦ ✦

                        1 Reply Last reply
                        1

                        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
                        OLVVDBO
                        OLVVDB
                        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