Skip to main content
[ADDON] Images Lazy Loading Started by emanuele · · Read 7281 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic

[ADDON] Images Lazy Loading

Images Lazy Loading v0.0.2
Introduction
Yet another simple addon: it makes all the images "lazy load"[1].
In order to do the lazy loading, the Lazy Load Plugin for jQuery is used.


License
o This ElkArte Addon is subject to the terms of the BSD "3-clause" license. You can obtain a copy of the License at http://opensource.org/licenses/BSD-3-Clause

Repository / Download
First result I found searching for lazy load :P
Last Edit: June 18, 2014, 06:32:41 am by emanuele
Bugs creator.
Features destroyer.
Template killer.

Re: Images Lazy Loading

Reply #1

It would be nice if you included Beta versions in the required version range - makes the testing easier. I had to modify it myself.

In package-info.xml the name and destination of the JavaScript file is incorrect. So it doesn't install unless you fix those.

Also I'm not sure if lazy loading all the images on the page is a good idea. Maybe you should just limit it to images in posts, signatures and avatars.

Re: Images Lazy Loading

Reply #2

Oook. I should not change my mind so often... :-\
Should be fixed now. Thanks! (And sorry for the troubles. :-[)

Yup, the first idea was avatars and attachments, then I wend for "everything" just because it was easier. lol
At the moment is more a childish game, rather than something really useful. :P

I'll play some more in the next days. ;D
Bugs creator.
Features destroyer.
Template killer.

Re: Images Lazy Loading

Reply #3

You don't seem to have THEMEDIR, so use $themedir. You can also just set the range as 1.0 beta 2 - 1.0.99; compareVersions() can handle that. (guess who coded it! :P)

For avatars, posts and signatures, you can just look for classes "avatar" and "bbc_image". Attachments don't seem to have a class attached to them but you could probably use the ";image" bit to catch them. (it would have been nice if they had a class though)

Re: Images Lazy Loading

Reply #4

I thought we changed for all-caps the theme dir as well.... meh.

 emanuele opens a ranting topic.
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] Images Lazy Loading

Reply #5

I don't know why, but this brought my forum to a crawl.  Uninstalled it and everything is snappy again.

Re: [ADDON] Images Lazy Loading

Reply #6

"Nice" to know.
It may be related to the buffer-rewriting it does in order to replace the images... I have to check it out more.
Bugs creator.
Features destroyer.
Template killer.


Re: [ADDON] Images Lazy Loading

Reply #8

It looks to me like it very well might. Why don't you give it a try?

Re: [ADDON] Images Lazy Loading

Reply #9

It works fine on 1.1.1.   ;)

Re: [ADDON] Images Lazy Loading

Reply #10

I've made a PR to the official repo, but until that makes it through the system, here is a minor update

  • Fix admin icons being hidden
  • prevent it from deferring images that were already browser deferred (a 1.1.9 update)
  • update from the 1.9.3 to 1.9.7 lib and defer it loading
  • allow standard 1.1 install
  • http->https in a few areas
Last Edit: November 06, 2022, 03:17:46 pm by Spuds