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 Cheight = document.querySelector('.sidequiz').offsetHeight;
const CTop = document.querySelector('.sidequiz').offsetTop;
Cheight = parseFloat(Cheight)+CTop;
if (scroll >= Cheight) {
$(".rigtads").addClass("newfixedclass");
}
if(scroll < Cheight) {
$(".rigtads").removeClass("newfixedclass");
}
});
});
$('.try_quiz_banner2').owlCarousel({
loop:true,
margin:30,
items:1,
nav:true,
dots:false,
autoplayHoverPause: true,
autoplaySpeed: 800,
responsive:{
0:{
items:1,
nav:true
},
767:{
items:2,
nav:true
},
992:{
items:2,
nav:true
},
1200:{
items:2,
nav:true
}
}
});