Lazyload Plugin

DerekMTL / 2012-11-08 18:52:04   

Hello!

I was hoping to implement the lazyload plugin on my news page but have a few questions.

I downloaded the plugin from this site appelsiini.net/projects/… and added it to my plugins folder

I added the this code between my tags in index.php

  1. <script src="jquery.js" type="text/javascript"></script>
  2. <script src="jquery.lazyload.js" type="text/javascript"></script>

I uploaded my images to my image file folder via .ftp and placed my image code in the body on my test exhibit (over and over)

  1. <img class="lazy" src="derekbroad.com/files/grey.gif" data-original="http://www.derekbroad.com/files/…;

Now I need to put this "in my code" but i am not really sure where? Does this also go in the index.php?

  1. $("img.lazy").lazyload();

As of right now I just get a grey block and my "data-original" does not load.

Any help would be greatly appreciated.
My test page is derekbroad.com/index.php/info/test/

Thanks!
Derek

arsondpi / 2012-11-09 13:03:56   

the class "lazy" needs to be added to the format so images can be generated dynamically (lines 172 and 193)

You don't need to load jquery again - so skip that 'cause its already in the template.
The javascript plugin needs to be added after line 57 - try something like:

  1. $OBJ->template->add_js('jquery.lazyload.js');

(that is assuming that you uploaded the plugin to the correct javascript folder)

As for the javascript line, try adding it to the code of line 62...

DerekMTL / 2012-11-10 00:23:24   

Hello,

Thanks you for your response! I am a bit new to jquery, so please forgive me.. lol
I just want to make sure I am doing the right thing!

I uploaded the jquery.lazyload.js to my site/ndxzsite/js folder. I noticed there is already a jquery.lazyload.min.js there. Hope this is okay

As far as the code, I am adding the

  1. $OBJ->template->add_js('jquery.lazyload.js');

to my index.php on on line 62? Is this the main index.php at the root or the one in my default folder?

I added my

  1.     <script src="jquery.js" type="text/javascript"></script>
  2.     <script src="jquery.lazyload.js" type="text/javascript"></script>

to the index.php in the default folder between the head tags. I hope this is correct.

And lastly, Adding the class "lazy" to lines 172 and 193, which file will I be adding this too?

Thanks again for all your help. Very much appreciated.

Thanks!

arsondpi / 2012-11-10 07:19:02   

Err- Derek, this requires code basics knowledge.
As I mentioned you don't need to load jquery again - so skip that 'cause its already in the template.
The rest need to be added in the actual format php file.

DerekMTL / 2012-11-10 15:58:05   

Okay, thanks for your help!

TwoOfEight / 2012-12-10 16:04:20   

Hi,

So, lazy load is already installed on indexibit v2.x.x ?
Beacause derekmtl said: '' I uploaded the jquery.lazyload.js to my site/ndxzsite/js folder. I noticed there is already a jquery.lazyload.min.js there. Hope this is okay ''

Vaska A / 2012-12-10 16:18:17   

It's in the files but we have not utilized it yet. There are issues with Lazyload that prevent it from working on some browsers - otherwise this would be much more simple.

TwoOfEight / 2012-12-10 16:56:56   

Aha, but if I download it and do what 'arsondpi' said it should work?

TwoOfEight / 2012-12-10 17:16:52   

Additionally; You mean it does not work on some browser due to the onboard lazyload version or due to other issues with indexebit itself as well if I update/load lazy load for myself?

arsondpi / 2012-12-10 17:17:07   

It's not that easy - you do need coding skills...

TwoOfEight / 2012-12-10 17:19:18   

Additionally; You mean it does not work on some browser due to the onboard lazyload version or due to other issues with indexebit itself as well if I update/load lazy load for myself?

Vaska A / 2012-12-10 17:21:08   

No, I actually mean the web browsers themselves - it's not an Indexhibit issue in that respect.

Why don't you simply try Pindaros' advice and see how it goes. I'm thinking on this a little bit but right now I have other things on my plate that need to be dealt with first.

TwoOfEight / 2012-12-10 17:37:53   

Ok. and who/where is Pindaros advice for what?

Vaska A / 2012-12-10 17:44:17   

His forum nick is arsondpi (look above).

TwoOfEight / 2012-12-10 18:17:55   

;-) ok. cheers

This thread has been closed, thank you.