How can I trigger an image load by clicking other element rather than the image itself (Lazy Load jQuery plugin)?
- by janoChen
In the Lazy Load plugin's documentation (A jQuery plugin that loads images only when an event occurs) says:
Event can be any jQuery event such as
click or mouseover. You can also use
your own custom events such as sporty
or foobar. Default is to wait until
user scrolls down and image appears on
the window. To prevent all images to
load until their grey placeholder
image is clicked you could do:
$("img").lazyload({
placeholder : "img/grey.gif",
event : "click"
});
In this case is clicking the image, but how can I trigger the image load by clicking other element rather than the image itself (say an anchor link/button)?