var url = $("html").attr( "data-site-url" ); var csrf_token = $("html").attr( "data-attr-csrf" ); var custom_base_url = $("html").attr( "data-custom-base-url"); ;(function(){ 'use strict'; var expandSearch = { init: function(){ var _this = this, _searchContainers = document.querySelectorAll('.expandSearch'); for( var _index in _searchContainers ){ if( typeof _searchContainers[ _index ] === 'object' ){ _this.searchFunctions( _searchContainers[ _index ] ); } } }, searchFunctions: function( _thisSearch ){ var _nodes = _thisSearch.childNodes; //a click _nodes[3].addEventListener('click',function(e){ if( _thisSearch.attributes.class.value.indexOf("showSearch") > -1 ){ _thisSearch.attributes.class.value = 'expandSearch'; } else{ _thisSearch.attributes.class.value = 'expandSearch showSearch'; } if( !e.preventDefault() ){ e.returnValue = false; } }); } }; //execute expandSearch.init(); }()); $(document).scroll(function() { $(window).scroll(function() { var scroll = $(window).scrollTop(); var ss =$('.home_side_ad .ad_container').height(); if (scroll >= ss) { $(".home_side_ad .ad_container").addClass("newfixedclassone"); } if (scroll < ss) { $(".home_side_ad .ad_container").removeClass("newfixedclassone"); } }); }); function quizmore($div_count){ $('#loadmore img').removeClass('d-none'); $('#loadmore span').css('display','none'); var count = $('#count').val(); var quizbox_layout_with_description = 1; $.ajax({ url: url+"/loadmore", type: 'post', dataType: 'json', data: {_token:csrf_token,count: count}, success: function(data){ if(data !== 'empty'){ $.each(data.rows, function(key,value) { if(value.data_type == "quiz") { var anc_url = url+'/quiz/'+value.slug; var img_url = custom_base_url+'upload/quiz-'+value.id+'/'+value.image; } else if(value.data_type == "article"){ var anc_url = url+'/article/'+value.slug; var img_url = custom_base_url+'upload/article-'+value.id+'/'+value.image; } else { var anc_url = url+'/game/'+value.slug; var img_url = custom_base_url+'upload/game-'+value.id+'/'+value.image; } if(value.alt_tag_quiz){ var altqu = value.alt_tag_quiz; }else{ var altqu = value.title; } if(quizbox_layout_with_description){ if (value.data_type === "article" && !value.about) { let str = value.description.replace('', ""); str = str.replace('