$(function(){ if($(window).width()>750){ $('.header .nav .item').hover(function(){ $(this).find('.child').stop(true).slideDown() },function(){ $(this).find('.child').stop(true).slideUp() }) $('.header .nav .child-item').hover(function(){ $(this).find('.third').stop(true).slideDown() },function(){ $(this).find('.third').stop(true).slideUp() }) }else{ $('.header .menu').click(function(){ $('.nav-m').stop(true).slideDown() }) $('.nav-m .close').click(function(){ $('.nav-m').stop(true).stop(true).slideUp() }) $('.nav-m li').click(function(){ if($(this).hasClass('rotate')){ $(this).removeClass('rotate') $(this).next('.child').stop(true).slideUp() }else{ $('.nav-m li').removeClass('rotate') $(this).addClass('rotate') $('.nav-m .child').stop(true).slideUp() $(this).next('.child').stop(true).slideDown() } }) $('.footer .f-nav-m li').click(function(){ if($(this).hasClass('rotate')){ $(this).removeClass('rotate') $(this).next('.child').stop(true).slideUp() }else{ $('.footer .f-nav-m li').removeClass('rotate') $(this).addClass('rotate') $('.footer .f-nav-m .child').stop(true).slideUp() $(this).next('.child').stop(true).slideDown() } }) } $('.header .search').click(function(e){ $('.header .search .popup').stop(true).fadeToggle() e.stopPropagation() }) $('.header .search .input').click(function(e){ e.stopPropagation() }) $('.header .search .btn').click(function(e){ var keyword=$.trim($('.header .search .input').val()) if(keyword==''){ $('.header .search .input').focus() layer.msg('璇疯緭鍏ュ叧閿瘝',{shift:6}) return false } location.href='/search?keyword='+keyword e.stopPropagation() }) $('.my-select > p').on('click', function(e){ $(this).next().stop(true).slideToggle() $(this).parents('.my-select').toggleClass('on') e.stopPropagation() }) $('.my-select').on('click','li',function(){ $(this).addClass('selected').siblings().removeClass('selected') $(this).parents('.my-select').find('p').text($(this).data('value')) }) $('.play').click(function(){ $('.video-popup').stop(true).fadeIn() $('.video-popup video').attr('src',$(this).attr('data-video')) }) $('.video-popup .close').click(function(){ var video=document.getElementById('video-popup-video') video.currentTime=0 video.pause() $('.video-popup').stop(true).fadeOut() }) $('.comment-popup .close').click(function(){ $('.comment-popup').hide() }) $('.comment-popup .field5 li').click(function(){ var code=$(this).data('code') $('.comment-popup .field6 p').text('璇烽€夋嫨鍩庡競') if(code==0){ $('.comment-popup .field6 ul').html('