$(function(){ /* window.onload = function() { */ var TOGGLE = $('.header2017_UUI .header_wrap_UUI .right_box_UUI .toggle_btn_UUI'); var DROPDOWN = $('.drop_down_menu_wrap_UUI .drop_down_menu_box_UUI'); var DROPDOWN_BG = $('.drop_down_bg_UUI'); var DROPDOWN_SPEED = 500; var Width = $(window).width(); TOGGLE.click(function() { if ($(this).children('.icon-animation_UUI').hasClass('active')) { $(this).css({'z-index': 0,'opacity': 1,'background': '#e84383'}); $(this).children('.icon-animation_UUI').removeClass('active'); DROPDOWN_BG.stop().animate({'z-index': '-100', 'opacity': 0},100); DROPDOWN.stop().animate({'top': '-1000px'}, DROPDOWN_SPEED); $(function(){ if(Width <= 960){ DROPDOWN.css('padding-top', '80px').stop().animate({'top': '-1000px'}, DROPDOWN_SPEED); } }); } else { $(this).css({'z-index': 100002,'opacity': 0.8,'background': '#e84383'}); $(this).children('.icon-animation_UUI').addClass('active'); DROPDOWN_BG.stop().animate({'z-index': '100000', 'opacity': 1}, 100); DROPDOWN.stop().animate({'top': '-15px'}, DROPDOWN_SPEED); $(function(){ if(Width <= 960){ DROPDOWN.css('padding-top', '115px').stop().animate({'top': '-55px'}, DROPDOWN_SPEED); } }); } }); DROPDOWN_BG.click(function() { if (TOGGLE.children('.icon-animation_UUI').hasClass('active')) { TOGGLE.css({'z-index': 0,'opacity': 1,'background': '#e84383'}); TOGGLE.children('.icon-animation_UUI').removeClass('active'); DROPDOWN_BG.stop().animate({'z-index': '-100', 'opacity': 0},100); DROPDOWN.stop().animate({'top': '-1000px'}, DROPDOWN_SPEED); $(function(){ if(Width <= 960){ DROPDOWN.css('padding-top', '80px').stop().animate({'top': '-1000px'}, DROPDOWN_SPEED); } }); }}); TOGGLE.hover(function() { $(this).stop().animate({'opacity': 0.8}, 200); }, function() { $(this).stop().animate({'opacity': 1}, 100); }); /* }; */ }); jQuery(document).ready(function($) { var topBtn = $('#page-top'); topBtn.hide(); $(window).scroll(function () { if ($(this).scrollTop() > 300) { topBtn.fadeIn(); } else { topBtn.fadeOut(); } }); });