I have a mobile site, with all the content on one PHP page, and the pages (or div\'s rather), are swapped with jQuery. I want to speed up the load time, and the bulk of what has
Please clarify the question. You want to completely load the content at certain user click or only thje images?
In that case you can do something like this:
HTML
JS(using jquery):
$('.load-gif').click(function(e) {
e.preventDefault();
var gif_url = $(this).attr('href'),
$gif_image = $('
').attr('src', gif_url),
$container = $(this).closest('.gif-container'),
$trigger = $(this);
$gif_image.load(function() {
$trigger.remove();
$container.append($gif_image);
});
});
Complete fiddle: https://jsfiddle.net/ryyoLgzz/