var piktogramyOnResize = function() { var screenWidth = document.body.clientWidth || document.documentElement.clientWidth || self.innerWidth; if (screenWidth < 1120) { $('#piktogramy_prave').hide(); } else { $('#piktogramy_prave').show(); } } $(function() { $("a[rel^=lightbox]").lightBox(); piktogramyOnResize(); $(window).resize(piktogramyOnResize); });