$(document).ready(function () { //hd $(".mobile_nav > .second_nav > li").each(function(){ $(".next_nav").parent().addclass("item2"); var x = null; $(".mobile_nav ul li").click(function () { var i = $(this).index(); if (x === i) { $(this).find(".next_nav").slideup(400); $(this).removeclass("item1"); x = -1 } else { $(this).find(".next_nav").slidedown(600); $(this).addclass("item1"); $(this).siblings().find(".next_nav").slideup(400); $(this).siblings().removeclass("item1"); x = i } }); }); if($(window).width() > 480){ $(window).scroll(function(){ if($(window).scrolltop() > 500){ $(".head").addclass("scro"); } else { $(".head").removeclass("scro"); } }) } $(".open_close .keyopen").click(function(){ // $(this).hide(0); $(".open_close .keyclose").fadein(500); $(".mobile_nav").toggleclass("sld"); }); $(".mobile_nav .keyclose").click(function(){ // $(this).hide(0); $(".open_close .keyopen").fadein(500); $(".mobile_nav").toggleclass("sld"); }); $(function () { var x = 1; $(window).resize(function () { if ($(window).width() > 1200 && x === 1) { $(".mobile_nav").removeclass("sld"); x = 2 } else { if ($(window).width() < 1200 && x === 2) { x = 1 } } }) }); //top // $(window).scroll(function() { // if($(".side_nav").offset().top > 800){ // $(".side_nav").fadein(500); // } // else{ // $(".side_nav").hide(); // } // $("#totop").click(function(){ // $("html,body").stop().animate( // {scrolltop:0}, // 500); // return false; // }); // }); $("#totop").click(function(){ $("html,body").stop().animate( {scrolltop:0}, 500); return false; }); $("#sd_tel").click(function(){ $(this).parent().siblings("span").toggleclass("on"); }); $("#sd_tel2").click(function(){ $(this).parent().siblings("span").toggleclass("on"); }); $("#sd_ewm").click(function(){ $(this).parent().siblings("span").toggleclass("on"); }); $("#sd_baba").click(function(){ $(this).parent().siblings("span").toggleclass("on"); }); $(function(){ scrollani(); }); function scrollani() { $('.js-m').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrolltop() + $(window).height() || _this.offset().top < $(window).scrolltop() - _this.outerheight()) { // _this.removeclass('animate'); } else if ($(window).scrolltop() > _this.offset().top - $(window).height() * 0.95) { _this.addclass('animate'); } }); $(window).scroll(function() { $('.js-m').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrolltop() + $(window).height() || _this.offset().top < $(window).scrolltop() - _this.outerheight()) { // _this.removeclass('animate'); } else if ($(window).scrolltop() > _this.offset().top - $(window).height() * 0.95) { _this.addclass('animate'); } }); }); } // ban key if (window.event) { document.captureevents(event.mouseup); } function nocontextmenu() { event.cancelbubble = true event.returnvalue = false; return false; } function norightclick(e) { if (window.event) { if (e.which == 2 || e.which == 3) return false; } else if (event.button == 2 || event.button == 3) { event.cancelbubble = true event.returnvalue = false; return false; } } document.oncontextmenu = nocontextmenu; // for ie5+ document.onmousedown = norightclick; // for all others //ban text // var omitformtags = ["input", "textarea", "select"]; // omitformtagsomitformtags = omitformtags.join("|"); // function disableselect(e) { // if (omitformtags.indexof(e.target.tagname.tolowercase()) == -1) { // return false; // } // } // function reenable() { // return true; // } // if (typeof document.onselectstart != "undefined") { // document.onselectstart = new function("return false"); // } else { // document.onmousedown = disableselect; // document.onmouseup = reenable; // } });