$(document).ready(function() { $('.menubtn').click(function(event) { $(this).toggleclass('open'); var _winw = $(window).width(); var _winh = $(window).height(); if ($(this).hasclass('open')) { $('body').addclass('open'); if (_winw <= 943) { $('.udede-nav').stop().slidedown(); } } else { $('body').removeclass('open'); if (_winw <= 943) { $('.udede-nav').stop().slideup(); } } }); $(window).on('resize', function(e) { if ($(window).width() > 943) { $('.menubtn').removeclass('open'); $('.hdr').css('display', ''); } }); if ($(".udede-nav li").find('dl').length) { }; function mynav() { var _winw = $(window).width(); if (_winw >= 943) { $('.udede-nav').show().addclass('nav-pc').removeclass('nav-m'); $('body,.menubtn').removeclass('open'); } else { $('.udede-nav').hide().addclass('nav-m').removeclass('nav-pc'); } } mynav(); $(window).resize(function(event) { mynav(); $('.menubtn').removeclass('open'); }); $('.nav-pc li').bind('mouseenter', function() { $(this).find('dl').stop().slidedown("fast"); if ($(this).find('dl').length) { $(this).addclass('ok'); } }); $('.nav-pc li').bind('mouseleave', function() { $(this).removeclass('ok'); $(this).find('dl').stop().slideup("fast"); }); $('.nav-m .v1').click(function() { $(this).parents('li').siblings('li').find("dl").stop().slideup("fast"); if ($(this).siblings('dl').length) { $(this).siblings('dl').stop().slidetoggle("fast"); $(this).toggleclass('on'); return false; } }); $(document).on('scroll', function() { var scrollh = $(this).scrolltop(); if (scrollh > $('.header').height()) { $('.udede-header .bottom').addclass('fixed'); } else { $('.udede-header .bottom').removeclass('fixed'); } }) $(".tab_click li").click(function(){ var tab=$(this).parent(".tab_click"); var con=tab.attr("id"); var on=tab.find("li").index(this); $(this).addclass('on').siblings(tab.find("li")).removeclass('on'); $(con).eq(on).show().siblings(con).hide(); }); $('.tab_click').each(function(index, el) { $(this).children('li').filter(':first').trigger('click'); }); $(".tab_click1 li").click(function() { console.log(111); var tab = $(this).parent(".tab_click1"); var con = tab.attr("id"); var on = tab.find("li").index(this); $(this).addclass('on').siblings(tab.find("li")).removeclass('on'); $(con).eq(on).addclass('show').siblings(con).removeclass('show'); }); $('[role=radio]').each(function() { var input = $(this).find('input[type="radio"]'), label = $(this).find('label'); input.each(function() { if ($(this).attr('checked')) { $(this).parents('label').addclass('checked'); $(this).prop("checked", true) } }) input.change(function() { label.removeclass('checked'); $(this).parents('label').addclass('checked'); input.removeattr('checked'); $(this).prop("checked", true) }) }) $('.kf .kf-side').click(function(){ var rt = $('.kf').css("right"); var num = parseint(rt); if(num < 0){ $('.kf').animate({ right: '20px' }, "slow"); $('.kf .kf-side span.arrow').addclass('on'); }else{ $('.kf').animate({ right: '-208px' }, "slow"); $('.kf .kf-side span.arrow').removeclass('on'); } }); $('.kt-top span.close').click(function(){ $('.kf').animate({ right: '-208px' }, "slow"); }); $('.kf .backtop').click(function() { $("html,body").stop().animate({ scrolltop: '0' }, 500); }); $('.udede-mobile-nav .mobso').click(function(event) { $(".top-2 .so").stop().slidetoggle(200); }); $('.ul-sub').eq(0).show(); $('.ul-txt-ins1 > li').click(function(){ var count = $('.ul-sub', $(this)).size(); if (count) { $(this).find('.ul-sub').toggle(); $('.ul-sub').not($(this).find('.ul-sub')).hide(); return false; } }); $('.ul-sub li').click(function(event) { event.stoppropagation(); }); });