New Native Lazy Loading Attribute for HTML img and iframe tags

Lazy loading your images just got a whole lot easier. If you’re not familiar, lazy-loading is the practice of delaying the load of certain content on a page until a user scrolls near it.

If a user never scrolls, the content never loads.

Page speed performance, mobile… good for all that.

Currently, you’ll need JavaScript to do this.

But, as of Chrome 75, that’s no longer necessary. A new attribute for <img> and <iframe> tags, loading” will be supported. Supported parameters are:

  • lazy: good candidate for lazy loading.
  • eager: not a good candidate for lazy loading. Load right away.
  • auto: browser will determine whether or not to lazily load.

Implementation is as such:

<img source="dope" loading="lazy">
<img source="dope" loading="eager">
<img source="dope" loading="auto">

<iframe src="dope.html" loading="lazy"></iframe>

If the loading attribute is not added, it defaults to “auto”. The best part is, even without full browser support, you can start implementing this now. It won’t affect anything if the browser doesn’t support it.

But, for the ones that do (once more and more browsers jump on board), the benefit will automatically kick in.

Anyway, one of the many little things in HTML that can make your life a lost easier… if you know them. There’s been more and more of this kind of stuff coming out lately.

One of the ways you can keep up with all of it is my Beginner’s Guide to HTML course on SkillShare. Discover all the little things you might have missed while learning how to write standards-compliant HTML.

And, we build real things.

Like a HTML5 audio and video player complete with a playlist and autoplay. In any case, if you want to keep going with your HTML training, you can access it for FREE over on SkillShare.

All the details on that are here: http://johnmorrisonline.com/skillshare

Later,

John

You might also like

Real-world alchemy

Question: what’s a simple way to pandemic proof your business? Or what about the next recession? There’s always one around the corner for one reason

Read More »

$5,857.20

That’s been the top, so far. The highest I’ve hit on Skillshare. And that IS just Skillshare. Doesn’t count Udemy, sales on my own website,

Read More »
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on reddit
Reddit
Share on pinterest
Pinterest
John Morris

JOHN MORRIS

I’m a 15-year veteran of freelance web development. I’ve worked with bestselling authors and average Joe’s next door. These days, I focus on helping other freelancers build their freelance business and their lifestyles.

The simple secrets to high-paying freelance clients

What makes clients willing to pay $5,000, $10,000 even $20,000 and up for your services? Download and install my mobile app and I’ll show you. It’s free. Just click the button below:

Clients Like:

Inc. Magazine Logo
Lewis Howes Logo
Ray Edwards Logo

WHAT OTHERS ARE SAYING

Michael Skye

Michael Skye

John is a man of integrity, who gives generously of himself to projects and people he cares about.

Bob Patterson

Not only is John a very talented programmer and developer, he is also an excellent communicator. He has a talent for taking complex subjects and communicating them in terms that anyone can understand. This is a rare combination. This ability has enabled me to take my skills and knowledge to the next level. Thank you John for for all that you do.

Jim DeJonge

Jim DeJonge

John has a relaxed and engaging manner. His advice is solid and the explanations are well thought out.

Ray Edwards

I recommend John every chance I get. If every person I worked with were as committed to excellence, punctuality, value, and unquestionable integrity… the world would be a better place. Highest recommendation.

Lori Grant

John did an outstanding job on my project. I highly recommend him and look forward to working with him on future projects.

Lewis Howes

John is amazing at building membership sites. He converted one of my sites over from it’s existing (hardly working) platform over to the clean and simple to use WishList membership platform. I highly recommend using John and WishList for any of your membership site needs.

Andrew Malone

Andrew Malone

John Morris is exceptional in his ability to give focused insight into Freelancing and starting one’s business. His direct methods inspire confidence in his honesty.

Steve Dimmick

Steve Dimmick

John has provided expert knowledge and advice on multiple occasions that have helped me better serve my clients. John is a Rockstar!

Aaron Gott

Aaron Gott

John has a particular knack for the development and training of others.

Oliver Wainwright

Oliver Wainwright

I’m a fan. I have completed several of John’s courses. I find him very knowledgeable and he has a great delivery.

Chris Aitken

He significantly improved my site through his expert knowledge of PHP, CSS and Javascript. Would definitely recommend John to others.

Thabo Motsoahae

John is one of the best instructors I have come across, I learned a lot from his online tutorials.

Sukh Plaha

John is a fantastic and patient tutor, who is not just able to share knowledge and communicate it very effectively – but able to support one in applying it. However, I believe that John has a very rare ability to go further than just imparting knowledge and showing one how to apply it. He is able to innately provoke one’s curiosity when explaining and demonstrating concepts, to the extent that one can explore and unravel their own learning journey. Thanks very much John!