$( window ).load(function() { render_size(); var url = window.location.href; $('.menu-item a[href="' + url + '"]').parent().addClass('is-active'); }); $( window ).resize(function() { render_size(); }); function render_size(){ var h_7065 = $('.h_7065 img').width(); $('.h_7065 img').height( 0.7065 * parseInt(h_7065)); var h_1048 = $('.h_1048 img').width(); $('.h_1048 img').height( 1.048 * parseInt(h_1048)); var h_625 = $('.h_625 img').width(); $('.h_625 img').height( 0.625 * parseInt(h_625)); var h_663 = $('.h_663 img').width(); $('.h_663 img').height( 0.663 * parseInt(h_663)); var h_463 = $('.h_463 img').width(); $('.h_463 img').height( 0.463 * parseInt(h_463)); var h_7386 = $('.h_7386 img').width(); $('.h_7386 img').height( 0.7386 * parseInt(h_7386)); } if (window.innerWidth > 768) { $(window).scroll(function () { if ($(window).scrollTop() >= 100) { $('.sticky-header').addClass('fixed'); } else { $('.sticky-header').removeClass('fixed'); } }); } if (window.innerWidth > 320) { $(window).scroll(function () { if ($(window).scrollTop() >= 100) { $('.sticky-header').addClass('clearfix'); } else { $('.sticky-header').removeClass('clearfix'); } }); }