?
Current File : /home/cideo/sainchargny/wp-content/themes/astra/customjs.js




jQuery(function ($) {
	
	
	
	//----------------!!!!-------------------------
	$('a[title]').each(function(idx, anchor) {
    var $anchor = $(anchor); 
    $anchor.attr('data-title', $anchor.attr('title')).removeAttr('title'); 
	});
	//----------------????-------------------------
	
	
	//var loaderdiv = $("<div class='loader'></div>");
	//$("body").prepend(loaderdiv);
	$(window).load(function() {
		
		$(".loader").addClass('loaded');
	});
	
var win = $(window);
var Wh = win.height();
var Ww = win.width();	

	
var headerH = $("#masthead").height();

var Hutil = (Wh - headerH);
	var pops = $(".popbox");
	
	
		//----------------mousemovecursor-------------------------
		
		$('.cursorchange').on({
		  mousemove: function(e) {
			$('.thecursor').css({
			  left: e.pageX,
			  top: e.pageY
			});
		  }
		});
	
	
				$( ".cursorchange" )
		  .mouseenter(function() {
			$('.thecursor').addClass("cursoron");
		  })
		  .mouseleave(function() {
			$('.thecursor').removeClass("cursoron");
					
		  });
		
		//-----------------------------------------
	
	
		//----------------START RESIZE-------------------------
	
	win.on('load resize',function(){ 
				
		var Wh = win.height();
		var Ww = win.width();
		var headerH = $("#masthead").height();
		
		
		
		var Hutil = (Wh - headerH);
		$(".fullintro").height(Hutil + 150);
		$("#menumobile").css("top" , headerH);
		
	
		
		if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
			
			
			$(".popbox").addClass("mob");
			
		}
			else{$(".popbox").removeClass("mob");}
		
		
		
		
			pops.each(function(k,v) {
				var popbox = $(this);
				var popboxH = popbox.outerHeight();
				var popcontent = $(".popcontent",popbox);
				var poptitleH = $(".elementor-widget-heading",popbox).outerHeight();
				var popcontentH = popcontent.outerHeight();
				var popcontentHclose = (poptitleH + 30);
				var popcontentHopen = (popcontentH + poptitleH);
				//console.log(popcontentH, poptitleH, popboxH, popcontentHclose);
				popbox.height(popcontentHclose);
				
					
				
			
				
				
				popbox.hover(function(){
			
					//popcontent.height(popcontentH);
					popbox.addClass('popactive');
					
					$(".thecursor").addClass('pophover');
					$(".popbox").not(this).addClass('popnotactive disable-hover');
					popcontent.addClass('showcontent');
					$('.popactive').height(popcontentHopen);
					
						
						//popbox.click(function() {
						//popbox.removeClass('popactive');
						//$(".popbox").not(this).removeClass('popnotactive');
						//popbox.height(popcontentHclose);

						//console.log('clicked');


						//});
					
					
					
					},function(){
					$(".thecursor").removeClass('pophover');
					$(".popbox").addClass('disable-hover');
					popbox.removeClass('popactive');
					$(".popbox").not(this).removeClass('popnotactive');
					popbox.height(popcontentHclose);
					popcontent.removeClass('showcontent');
					
					setTimeout(function(){
					  $(".popbox").removeClass('disable-hover');
						console.log('timeout!');
					}, 700);
					//popbox.addClass('disable-hover');
					
					
				


				}); 
				
				
				
				
				
				
				
				
			});
		
		
				
				
		
		
		

}).resize(); //END RESIZE
	
		pops.each(function(k,v) {
		
		var popbox = $(this);
		
		var popcontent = $(".popcontent",popbox);
			
		
			
			
			

		
		
		
	});
	
	
	
	
	
		
	
	
	
	
	//-------------------------------------PARALLAX
	
	$(".parallaxbg").each(function() {
		var img = $(this);
		var bg = img.css('background-image');
		var bgpos = img.css('background-position');
		img.css('background-image', 'none');
		var div = $("<div class='parabox zoombgout'><div class='paracontainer' style='background-image:" + bg + "' data-bottom-top='transform:translateY(0%);' data-top-bottom='transform:translateY(-25%);'></div></div>");
		//div.addClass("paracontainer");
		//$(".paracontainer").css({'backgroundImage': bg , 'background-position' : bgpos});
		img.prepend(div);
	}); 
	
	
	//-------------------------------------PARALLAX END
	
	
				// Function from David Walsh: http://davidwalsh.name/css-animation-callback
		function whichTransitionEvent(){
		  var t,
			  el = document.createElement("fakeelement");

		  var transitions = {
			"transition"      : "transitionend",
			"OTransition"     : "oTransitionEnd",
			"MozTransition"   : "transitionend",
			"WebkitTransition": "webkitTransitionEnd"
		  }

		  for (t in transitions){
			if (el.style[t] !== undefined){
			  return transitions[t];
			}
		  }
		}

		var transitionEvent = whichTransitionEvent();

		  
	
	
	
	
	
	
	


$("#trigmenumob").click(function(){
					   
					   $("body").toggleClass("menuopen");
	$("html").toggleClass("oh");
					   
					   
					   });
	

	

	
	

	
	
		//-------------------------------------
	
	
	
	
	
	

		

	
	


	
	
	var s = skrollr.init({
		smoothScrolling : true,
		forceHeight : false
		
		
	});
	
	
		var body = document.body,
		timer;

	window.addEventListener('scroll', function() {
	  clearTimeout(timer);
	  if(!body.classList.contains('disable-hover')) {
		body.classList.add('disable-hover');
	  }

	  timer = setTimeout(function(){
		body.classList.remove('disable-hover');
	  },300);
	}, false);
	
	
	
	
	
	
	
	
	
});