Skip to main content

Jellyfish gets iframe support

Over the weekend I added iframe support to Jellyfish.

In addition to images, you can now lazy load YouTube and Vimeo videos, SlideShare presentations and more. Jellyfish also picked up new callbacks and more options, making it easier for you to customize it for your projects.

Check it out on GitHub.

2 Comments

Leave a comment or contact me on Twitter at @ChrisFerdinandi.


vijay rudraraju

Hi Chris,
My .js skills are poor. Quick question/idea. Rather than:

<div data-lazy-load="img/elephant.jpg">
<a href="img/elephant.jpg">View Photo</a>
</div>

could we have?

<img data-load="lazy-load" src="img/elephant.jpg" />

could you then have a .js test in the header and if supported remove src to prevent images from loading. if .js is unsupported/disabled, regular images display (not links). Your thoughts?


Chris Ferdinandi

@vijay – great idea in concept, but wouldn’t work in practice for two reasons:

  1. JS in the header blocks the downloading of other files, slowing down render times and resulting in poorer actual and perceived performance.

  2. Most modern browsers prefetch images to speed up the time it takes for them to render them. As a result, many images would get downloaded ahead of time, even with a script in place to remove them from the markup.

Leave a Comment

Share links, code and more with Markdown.