Commit 853c248e by o.kimura

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

parent 8d9c5b0e
$(document).ready( function() {
mobileNav();
smoothScroll();
gSearch();
$(document).ready(function () {
mobileNav();
smoothScroll();
gSearch();
});
$( function () {
/* 言語切り替え */
$('#lang select').change( function() {
if ($(this).val() != '') {
window.location.href = $(this).val();
}
});
$(function () {
/* 言語切り替え */
$('#lang select').change(function () {
if ($(this).val() != '') {
window.location.href = $(this).val();
}
});
// toggle menu
var toggle = $('#toggle_btn');
var toggle_menu = $('#toggle_menu');
var overlay = $('.overlay');
toggle.on( 'click', function() {
if ( $(this).hasClass('active') ) {
$(this).removeClass('active');
toggle_menu.slideUp('fast');
overlay.slideUp('fast');
} else {
$(this).addClass('active');
toggle_menu.slideDown('fast');
overlay.slideDown('fast');
}
return false;
});
overlay.on( 'click', function(){
toggle.removeClass('active');
toggle_menu.slideUp('fast');
overlay.slideUp('fast');
});
// toggle menu
var toggle = $('#toggle_btn');
var toggle_menu = $('#toggle_menu');
var overlay = $('.overlay');
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 () {
toggle.removeClass('active');
toggle_menu.slideUp('fast');
overlay.slideUp('fast');
});
});
/* モバイル用ナビゲーション */
var mobileNav = ( function() {
var openFlg = 0;
var ua = navigator.userAgent;
$('#toggle').click(function(){
if(openFlg == 0){
$('#navi').addClass("open");
$('#toggle').addClass("open");
$('#head_menu').addClass("open");
$('#menu01').addClass("open");
$('#head_area .search').addClass("open");
$('header h1').addClass("non");
$('header #title').addClass("non");
$('#lang').addClass("non");
openFlg = 1;
} else {
$('#navi').removeClass("open");
$('#toggle').removeClass("open");
$('#head_menu').removeClass("open");
$('#menu01').removeClass("open");
$('#head_area .search').removeClass("open");
$('header h1').removeClass("non");
$('header #title').removeClass("non");
$('#lang').removeClass("non");
openFlg = 0;
}
});
var mobileNav = (function () {
var openFlg = 0;
var ua = navigator.userAgent;
$('#toggle').click(function () {
if (openFlg == 0) {
$('#navi').addClass("open");
$('#toggle').addClass("open");
$('#head_menu').addClass("open");
$('#menu01').addClass("open");
$('#head_area .search').addClass("open");
$('header h1').addClass("non");
$('header #title').addClass("non");
$('#lang').addClass("non");
openFlg = 1;
} else {
$('#navi').removeClass("open");
$('#toggle').removeClass("open");
$('#head_menu').removeClass("open");
$('#menu01').removeClass("open");
$('#head_area .search').removeClass("open");
$('header h1').removeClass("non");
$('header #title').removeClass("non");
$('#lang').removeClass("non");
openFlg = 0;
}
});
});
var gSearch = ( function() {
var cx = '002492979778199743801:oaprkry4gm4';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
var gSearch = (function () {
var cx = '002492979778199743801:oaprkry4gm4';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
});
/* smooth scroll */
var smoothScroll = ( function() {
$('.pagetop a').click(function() {
var speed = 400;
var href= $(this).attr("href");
var target = $(href == "#" || href == "" ? 'html' : href);
var position = target.offset().top;
$('body,html').animate({scrollTop:position}, speed, 'swing');
return false;
});
var smoothScroll = (function () {
$('.pagetop a').click(function () {
var speed = 400;
var href = $(this).attr("href");
var target = $(href == "#" || href == "" ? 'html' : href);
var position = target.offset().top;
$('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