Commit 853c248e by o.kimura

メニュー表示色調整・スクロール阻止

parent 8d9c5b0e
$(document).ready( function() {
$(document).ready(function () {
mobileNav();
smoothScroll();
gSearch();
});
$( function () {
/* 言語切り替え */
$('#lang select').change( function() {
$(function () {
/* 言語切り替え */
$('#lang select').change(function () {
if ($(this).val() != '') {
window.location.href = $(this).val();
}
......@@ -17,19 +17,25 @@ $( function () {
var toggle = $('#toggle_btn');
var toggle_menu = $('#toggle_menu');
var overlay = $('.overlay');
toggle.on( 'click', function() {
if ( $(this).hasClass('active') ) {
toggle.on('click', function () {
if ($(this).hasClass('active')) {
$(this).removeClass('active');
toggle_menu.slideUp('fast');
overlay.slideUp('fast');
$("html").css("overflow-y", "auto");
$("body").removeClass('active');
} else {
$(this).addClass('active');
toggle_menu.slideDown('fast');
overlay.slideDown('fast');
$("html").css("overflow-y", "hidden");
setTimeout(function () {
$("body").addClass('active');
}, 100);
}
return false;
});
overlay.on( 'click', function(){
overlay.on('click', function () {
toggle.removeClass('active');
toggle_menu.slideUp('fast');
overlay.slideUp('fast');
......@@ -39,11 +45,11 @@ $( function () {
});
/* モバイル用ナビゲーション */
var mobileNav = ( function() {
var mobileNav = (function () {
var openFlg = 0;
var ua = navigator.userAgent;
$('#toggle').click(function(){
if(openFlg == 0){
$('#toggle').click(function () {
if (openFlg == 0) {
$('#navi').addClass("open");
$('#toggle').addClass("open");
$('#head_menu').addClass("open");
......@@ -68,7 +74,7 @@ var mobileNav = ( function() {
});
var gSearch = ( function() {
var gSearch = (function () {
var cx = '002492979778199743801:oaprkry4gm4';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
......@@ -80,16 +86,15 @@ var gSearch = ( function() {
});
/* smooth scroll */
var smoothScroll = ( function() {
$('.pagetop a').click(function() {
var smoothScroll = (function () {
$('.pagetop a').click(function () {
var speed = 400;
var href= $(this).attr("href");
var href = $(this).attr("href");
var target = $(href == "#" || href == "" ? 'html' : href);
var position = target.offset().top;
$('body,html').animate({scrollTop:position}, speed, 'swing');
$('body,html').animate({
scrollTop: position
}, speed, 'swing');
return false;
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment