$(document).ready(function() { if($(document).width() > 800) { $('#upper-promo-block2').hide(); } else { $('#upper-promo-block2').show(); } $(window).on('resize', function() { if($(document).width() > 800) { $('#upper-promo-block2').hide(); } else { $('#upper-promo-block2').show(); } }); setTimeout(function() { $('body').on('click', '.top-mobilecustom', function(event) { var id = $(this).data('id'); if($(this).hasClass('plus')) { event.preventDefault(); if ($(this).hasClass('opened')) { $(this).find('.custom-text').text('+'); $('.mobilecustom-link-children.children-parent-' + id).hide(); } else { $(this).find('.custom-text').text('-'); // $('.mobilecustom-link-children').hide(); $('.mobilecustom-link-children.children-parent-' + id).show(); } $(this).toggleClass('opened'); } }); }, 500); });