(function($) { $(document).ready(function(){ //setting //on off rollover,advance load var src_on = "_on.", src_off = "_off.", //to page,to top offset = 0, scroll_speed = "slow", //opacty rollover on_speed = 0, off_speed = "fast", transp = 0.7, //pngfix exclusion png_exc = "exc"; //hover $(".hover").hover( function(){ $(this).stop(true, true).fadeTo(300,0.5); }, function(){ $(this).stop(true, true).fadeTo(300,1.0); }); //to page $("a.to_page").click(function(){ var href = $(this).attr("href"); href = href.split("#"); if($("#" + href[1]).size() > 0 || href[0] == ""){ var p = $("#" + href[1]).offset().top - offset; $("html,body").animate({ scrollTop:p },scroll_speed); return false; } }); //to top $("a.to_top").click(function(){ $("html,body").animate({ scrollTop:0 },scroll_speed); return false; }); //slide var slick = $('.slide01').slick({ dots: false, infinite: true, speed: 1000, slidesToShow: 1, autoplay: true, fade: false, adaptiveHeight: true }); var HeightArrange = function(targetEl) { this.targetEl = $(targetEl); }; HeightArrange.prototype.fn = function() { var that = this; $(window).on('load resize', function() { var heightList = new Array(); var $winWidth = $(window).width(); that.targetEl.css({ 'min-height': '100%' }); that.targetEl.each(function(index) { var $eachThis = $(this); setTimeout(function() { heightList[index] = $eachThis.outerHeight(); var maxH = Math.max.apply(null,heightList); that.targetEl.css({ 'min-height': maxH + 'px' }); },500) }); }); }; var HeightArrangeText = new HeightArrange('.tile01'); HeightArrangeText.fn(); var HeightArrangeText2 = new HeightArrange('.tile02'); HeightArrangeText2.fn(); }); })(jQuery);