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

Get off your knees

Stop acting like your client’s servant — like you’re there to kowtow to their every whim and wish and you’re lucky they’ve graced you with

Read More »

Chicks dig this s***

Saw this scrub on Twitter post this namby-pamby bullshizen: === I will NEVER be impressed by your money, car, looks, social status or job title.

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

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.

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.

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.

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.

Bradley Smith

John and I have worked together on numerous projects. John is very quick and efficient and was a pleasure to work with.

Daniel Mohlendick

On the Freelancing on Upwork course: “This is by far the best course i have watched on Skillshare!! Thank you so much.”

Xan Barksdale

Xan Barksdale

Very professional worker who is extremely knowledgable in WordPress and Wishlist Member. I would definitely hire again.

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.

Aaron Gott

Aaron Gott

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

Michael Skye

Michael Skye

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

Chris Aitken

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