$(document).scroll(function(){ var m_top0=$(".con-header").offset().top; var top = ($(window).scrollTop()); if(!$("body").hasClass("bodys")){ if(m_top0 >= top){ $(".bocweb-header").removeClass('fixed active whitefixed'); // $("body").removeClass("onsactive-on"); $("body").removeClass("body-black botbg"); }else if(m_top0 <= top){ $(".bocweb-header").addClass('fixed active whitefixed'); // $("body").addClass("onsactive-on"); $("body").addClass("body-black botbg"); } } }); function mains(id,id1){ $(".bocweb-header .bocweb-nav .nav").eq(id).addClass("active").find(".nav-tops").addClass("active"); $(".bocweb-header .bocweb-nav .nav.active .li").eq(id1).addClass("active").siblings().removeClass("active"); $(".con-boxlist .tit-menu .items").eq(id1).addClass("active").siblings().removeClass("active"); } function clickVideo(selector){ var video = document.getElementById('video'); selector.on('click',function(){ $('.video-fixed').stop(true,true).removeClass('ons').hide(); $('.video-fixed').fadeIn().delay(500).addClass('ons'); // video.play(); $("html,body").addClass('on-foxed') var videoSrc = $(this).attr('data-swf'); $('#video').fadeIn(500).attr('src',videoSrc); }) $('.video-fixed .cha').on('click',function(){ $('.video-fixed').removeClass('ons').delay(500).fadeOut(); // video.pause(); $("html,body").removeClass('on-foxed') $('#video').fadeOut(500).attr('src',""); }) $(".video-fixed").on("click",function(){ $('.video-fixed').removeClass('ons').delay(500).fadeOut(); $("html,body").removeClass('on-foxed') $('#video').fadeOut(500).attr('src',""); }) $(".video-fixed .videoboxs").on("click",function(e){ e.stopPropagation() }) } function getUrlParam(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r!=null) return unescape(r[2]); return null; } $(window).scroll(function(){ // if($("div").hasClass("con-itemsbox")){ // var wraps=$(".con-itemsbox").offset().top - $(".con-header").innerHeight(); // var tops = ($(window).scrollTop()); // if(tops >= $(".con-itemsbox").offset().top){ // $(".con-boxlist .con-fleft").addClass('fixed'); // }else if(tops < $(".con-itemsbox").offset().top){ // $(".con-boxlist .con-fleft").removeClass('fixed'); // } // }; }) $(".m-header .nav-btn").on('click', function() { var _this = $(this); if (!$(this).hasClass('hover')) { $(".search-bg").slideUp(); $(this).addClass('hover'); $(this).children('.line1').stop().transition({rotate:45},300); $(this).children('.line2').stop().fadeOut(300); $(this).children('.line3').stop().transition({rotate:-45},300,function(){ _this.addClass('active'); }); $(this).parents(".w-header").siblings('.sub-menu').stop().fadeIn(); $(".m-header .list-cont").addClass('active'); $("body,html").addClass('ovh'); }else{ $(this).removeClass('hover'); $(this).removeClass('active'); $(this).children('.line1').stop().transition({rotate:0},300); $(this).children('.line2').stop().fadeIn(300); $(this).children('.line3').stop().transition({rotate:0},300); $(this).parents(".w-header").siblings('.sub-menu').stop().fadeOut(); $(".m-header .list-cont").removeClass('active'); $("body,html").removeClass('ovh'); } }); $(".m-header .sub-menu .sub-tit").on('click', function() { $(".m-header .search-bg").slideUp(); if ($(this).siblings('.sec-list').is(':hidden')){ $(this).addClass('on'); $(this).siblings('.sec-list').stop().slideDown(); $(this).parent().siblings('li').children('.sec-list').stop().slideUp().siblings('.tit').removeClass('on'); }else{ $(this).removeClass('on'); $(this).siblings('.sec-list').stop().slideUp(); } }); $(".bocweb-header .bocweb-nav .nav-tops").on("mouseenter",function(){ $(this).siblings(".nav-bots").stop().slideToggle().parents(".nav").siblings().find(".nav-bots").stop().hide(); }) $(".bocweb-header").on("mouseleave",function(){ $(".bocweb-header .bocweb-nav .nav-bots").slideUp(); }) $(".bocweb-footerbots .select .selects-tops").on("click",function(){ $(this).siblings(".selects-bots").stop().slideToggle(); })