From b31c610d6c9a95373987ebff76df357e81f8f31d Mon Sep 17 00:00:00 2001 From: Manuel Hiebel Date: Mon, 18 Aug 2014 22:30:36 +0200 Subject: lazy log of images load images only before they are needed, will reduce global time and size (and fix the removing of buttons if JavaScript disabled) --- en/5/download_index.php | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'en/5') diff --git a/en/5/download_index.php b/en/5/download_index.php index 286061c20..b5a18f76d 100755 --- a/en/5/download_index.php +++ b/en/5/download_index.php @@ -54,6 +54,11 @@ echo $torrent && !$torrentavailable ? sprintf(_t('forthcoming')) : sprintf('%s', $src, $ttl, $ttl, $sty); + echo sprintf('%s', $src, $ttl, $ttl, $sty); +} + ?> @@ -147,7 +152,7 @@ input[type="radio"], input[type="submit"] {
@@ -267,11 +272,13 @@ input[type="radio"], input[type="submit"] {
- GNOME + +
- KDE + +
@@ -538,6 +545,15 @@ $($cl).tooltipsy({ }); } +function lazyload(){ + $('img.lazy').each(function(){ + $(this) + .attr( 'src', $(this).data('src') ) + .removeClass('hidden') + .removeAttr('data-src'); + }); +} + $('#iso2usb,#arch,#nat,#desktop,#livespin,#dllink').hide(); $('input[name=format]').click(function () { $('#arch,label[for="dual"]')[this.id == 'classical' ? 'slideDown' : 'slideUp'](); @@ -570,13 +586,12 @@ $($cl).tooltipsy({ $('input[id="32b"]').prop('checked', true); } $('label[for="64b"],#64bex')[$('#livecd').is(':checked') ? 'slideUp' : 'slideDown'](); + lazyload(); }); $('input[name=desktop]').click(function () { $('#arch')[ $('#gnome,#kde').is(':checked') ? 'slideDown' : 'slideUp'](); - if (checked) { scrolltoid('#arch') - } }); $('input[name=arch]').click(function () { -- cgit v1.2.1