Log in

View Full Version : Loading Images on a website - Javascript



Anikanje
09-23-2012, 09:43 PM
Hi Guys,

I am new to HTML, Javascript and CSS. I am looking for a script that loads an image only when the image in in view. I have searched and found answers on this website but the viewer doesn't see the image load. An example of such a site is http://annasafroncik.it/

I did the whole view source thing and tried to work my way through it but it is a bit overwhelming. I also tried to search for the answer but I am not sure what this effect is called, and as soon as I think "Good job Sherlock you found it!!" it turns out I chased the wrong lead.

Another question is does jquery need server side?

Thanks guys.

jscheuer1
09-23-2012, 10:01 PM
I think you want lazy load:

http://www.appelsiini.net/projects/lazyload

And no, jQuery doesn't require server side. It can use it, but doesn't need it, and the lazy load script doesn't need server side.

jQuery is simply a library of javascript routines. It cannot do anything that javascript can't do. However, it enables one to do far more with less code. As I say it can use server side. So can ordinary javascript. But just like ordinary javascript, it doesn't require server side. Both jQuery and javascript are primarily client side - depending only upon the user's browser having javascript enabled.

Anikanje
09-24-2012, 09:17 AM
Thanks very much for the help John