$('#searchtext').on('input', function() { var query = $(this).val(); $.ajax({ url: '/Q2xHVGRsQydmRZbkNCR2tUbGQ', method: 'POST', dataType: 'json', data: { input: query }, success: function(suggestions) { $('#searchtext').autocomplete('option', 'source', suggestions); } }); }); $('#searchtext').autocomplete({ minLength: 2, open: function(event, ui) { if($(window).width() <= 655){ $('.ui-autocomplete').css('width', $(window).width()); }else{ $('.ui-autocomplete').css('width', $('#mobile_search_container').width()); } }, change: function(event, ui) { if (this.onchange) { this.onchange(); } } });var elementList = ['searchtext'], separatorList = [''], mobileMax = 655, searchBarWidth = 635, searchBarDiff = 130, mobileMenuDiff = $('#search').height() + 136, element_clickCount = 0, screenHeight = $(window).height(), screenWidth = $(window).width(), element_int; if(screenWidth <= mobileMax){ var MenuHeight = screenHeight - mobileMenuDiff, mobileSearchWidth = screenWidth - searchBarDiff; }else{ var mobileSearchWidth = searchBarWidth, MenuHeight = screenHeight - mobileMenuDiff; } function animate_mobile_menu(){ $('#mobile_menu_logo').attr('onclick',''); if ($("#mobile_menu_logo").attr("data-chckd")=="false"){ $('body').css('overflow-x','hidden'); $('#mobile_menu').css('display','inherit'); $('.page').width($(window).width()); $('.two_color_bg').animate({ "left": "+=200px" }, 500); $('.page_background').animate({ width: ($(window).width() - 200) + 'px'}, 500, function (){ $('body').css('overflow-x','hidden'); $('.page_background, .two_color_bg').width('calc(100% - 200px)'); $('.page').width($(window).width()); complete:$('#mobile_menu_logo').attr('onclick','animate_mobile_menu()'); complete:$('#mobile_menu_logo').attr("data-chckd","true"); }); $('.floatleft_box, .not_found').width($(window).width()); $('#mapcontainer').animate({width: ($(window).width() - 200) + 'px'}, 500,function () { $('#mapcontainer').width('calc(100% - 200px)'); }); }else if($("#mobile_menu_logo").attr("data-chckd")=="true"){ $('.page').width($(window).width()); $('.two_color_bg').animate({ "left": "-=200px" }, 500); $('.page_background').animate({ width: ($(window).width()) + 'px'}, 500,function () { $('.page_background, .page').width(''); $('.two_color_bg').width('100%'); complete:$('#mobile_menu').css('display','none'); complete:$('body').css({'overflow-x':'','background':''}); complete:$('#mobile_menu_logo').attr('onclick','animate_mobile_menu()'); complete:$('#mobile_menu_logo').attr("data-chckd","false"); }); $('.floatleft_box, .not_found').width($(window).width()); $('#mapcontainer').animate({width: ($(window).width()) + 'px'}, 500,function () { $('#mapcontainer').width('100%'); complete:$('.floatleft_box, .not_found').width(''); complete:$('#mobile_menu').css('display','none'); complete:$('#mobile_menu_logo').attr('onclick','animate_mobile_menu()'); }); } } $(window).load(function(){ if(screenWidth <= mobileMax){ $(window).on("scroll",function(){ $('.categories_background').css('background','#d3d3d3 url("https://datascop.ro/includes/background_categories.jpg") no-repeat center top'); $('.footer_background').css('background','#595959 url("https://datascop.ro/includes/background_footer.jpg") center top no-repeat'); setTimeout(function(){ $('.gpse').append('
Caută mai multe date oficiale:


'); },1000); setTimeout(function(){ $('.footer_fb').append('
datascop.ro
') },3000); $(window).off("scroll") }) }else{ $('.gpse').append('
Caută mai multe date oficiale:


'); $('.footer_fb').append('
datascop.ro
'); $('.categories_background').css('background','#d3d3d3 url("https://datascop.ro/includes/background_categories.jpg") no-repeat center top'); $('.footer_background').css('background','#595959 url("https://datascop.ro/includes/background_footer.jpg") center top no-repeat') } });