From bee1f5733ea92f3219ed64ac53f1fd992a5cf31a Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 29 Jan 2018 21:08:14 +0100 Subject: Konditionales Lazyloading. --- gospeladlershof.de/static/js/gospelchor.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gospeladlershof.de/static/js/gospelchor.js b/gospeladlershof.de/static/js/gospelchor.js index 70c7631..4db2b70 100644 --- a/gospeladlershof.de/static/js/gospelchor.js +++ b/gospeladlershof.de/static/js/gospelchor.js @@ -121,8 +121,14 @@ $(window).load(function(){ } }); $(document).ready(function(){ - lzld(document.getElementById('img-chor-alt')); - lzld(document.getElementById('osm')); + chor_tmp = document.getElementById('img-chor-alt'); + if ( null != chor_tmp ) { + lzld(chor_tmp); + } + chor_tmp = document.getElementById('osm'); + if ( null != chor_tmp ) { + lzld(chor_tmp); + } var thumbs = document.getElementsByClassName("chor-thumbnail"); for( i = 0; i < thumbs.length; i++) { -- cgit v1.2.3