GabeJonson
3/21/2016 - 8:32 AM

main.css on load

main.css on load

var disableWheel = function() {
	if (document.addEventListener) {
		if ('onwheel' in document) {
		// IE9+, FF17+, Ch31+
			document.addEventListener("wheel", onWheel);
		} else if ('onmousewheel' in document) {
		// устаревший вариант события
			document.addEventListener("mousewheel", onWheel);
		} else {
			// Firefox < 17
			document.addEventListener("MozMousePixelScroll", onWheel);
		}
	} else { // IE8-
		document.attachEvent("onmousewheel", onWheel);
	}

	function onWheel(e) {
		e.preventDefault();
	}
}
var count = parseInt($('.row').width() / $('.project-block').width()); // get container then devided it on block

var items = $('.project-block .project-title'); // autoheight block

for (var i = 0; i < items.length; i += count) {
  var maxheight = 0;
  for (var j = i; j < i + count; j++) {
    var height = $(items[j]).height();
    if (maxheight < height) {
      maxheight = height;
    }
}

  for (var j = i; j < i + count; j++) {
    $(items[j]).height(maxheight);
  }
}
var cb = function() {
	var l = document.createElement('link'); 
	l.rel = 'stylesheet';
	l.href = 'link/to/main.css';
	var h = document.getElementsByTagName('head')[0]; h.parentNode.insertBefore(l, h);
};
var raf = requestAnimationFrame || mozRequestAnimationFrame || webkitRequestAnimationFrame || msRequestAnimationFrame;
if (raf) raf(cb);
else window.addEventListener('load', cb);
var imageArray = [],
		imageItem = document.getElementsByTagName('img');

imageArray.push(imageItem);

imageArray.map(function(element) {
	var lengthOfItems = element.length;
	
	for(var i = 0; i <= lengthOfItems; i++) {
		var returnedImageWidth = imageCheck(element[i].currentSrc);

		if(returnedImageWidth > 306) {
			element[i].style.width = returnedImageWidth + 'px';
			element[i].style.position = 'absolute';
			element[i].style.left = returnedImageWidth / 2 + 'px';
		}
	}
});

function imageCheck(image) {
	var imageHref = image,
			image = new Image();

	image.src = imageHref;

	var imageWidth = image.width;

	return imageWidth;
}
    $('a:not(#fp-nav a)').click(function(e) {
        if( $(this).find('wave-class').length ===0 ) $(this).prepend('<div class="wave-class"></div>');

        var wave = $(this).find('.wave-class');

        wave.css({
            'top': e.pageY + 100 + 'px',
            'left': e.pageX + 'px'
        }).addClass('animate');

        url = this.href;
        setTimeout('location.href = url', 500);
        this.href = 'javascript:void(0)';
    });