//pagetop $(document).ready(function () { var pagetop = $('.pagetop'); $(window).scroll(function () { if ($(this).scrollTop() > 100) { pagetop.fadeIn(); } else { pagetop.fadeOut(); } }); pagetop.click(function () { $('body, html').animate({ scrollTop: 0 }, 500); return false; }); }); //fixedの崩れ防止 if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod') {setTimeout('scrollTo(0,1)',100);} //form check validation $(function () { $('form input:required').on('change', function () { $(this.form).find('.GoImportant').attr('disabled', !this.form.checkValidity()); }); }); $(function () { $(document.forms[0]).find('.GoImportant').attr('disabled', !document.forms[0].checkValidity()); }); jQuery(function ($) { $('.article-title').on('click', function () { /*クリックでコンテンツを開閉*/ $(this).next().slideToggle(200); /*矢印の向きを変更*/ $(this).toggleClass('open'); }); }); jQuery(function ($) { $('.article-title2').on('click', function () { /*クリックでコンテンツを開閉*/ $(this).next().slideToggle(200); /*矢印の向きを変更*/ $(this).toggleClass('open'); }); }); jQuery(function ($) { $('.article-title3').on('click', function () { /*クリックでコンテンツを開閉*/ $(this).next().slideToggle(200); }); }); /*ポップアップ表示 郵便番号から検索*/ // $("#popup-on2").on("click", function(){ // showpopup2(); // }); function showpopup2(){ $(".popup2").addClass("active"); var agent = window.navigator.userAgent.toLowerCase(); var ipad = agent.indexOf('ipad') > -1 || agent.indexOf('iphone') > -1 || agent.indexOf('android') > -1 || agent.indexOf('macintosh') > -1 && 'ontouchend' in document; if(ipad == false){ var selectCount = $('#own_selection').children('option').length; $('#own_selection').attr('size',selectCount > 5 ? 5 : selectCount); $('#own_selection').css({"height": "auto"}); } } $("#popup-on3").on("click", function(){ $(".popup").css({"opacity": "1","z-index": "999",}); }); $(".icon-close").on("click", function(){ $(".popup2").removeClass("active"); $(".popup").css({"opacity": "0","z-index": "-1",}); }); /*郵便番号バリデーション*/ var repostal = function(str) { str = str.replace(/[A-Za-z0-9]/g, function (s) { return String.fromCharCode(s.charCodeAt(0) - 0xFEE0); })// 英数 str = str.replace(/\ー|\‐|\‑|\–|\—|\―|\−|\ー|\-/g, '-'); // 色々なハイフンも統一 str = str.replace(/[\t\s ]/g, ''); // タブやスペースを消す return str; } $(function () { $('input[name="postal_code"] ').on('blur', function() { var str = $(this).val(); $(this).val(repostal(str)); $(this).valid(); }); /* $('input[name="emg_postal_code"] ').on('blur', function() { var str = $(this).val(); $(this).val(repostal(str)); $(this).valid(); }); $('input[name="tell"]').on('blur', function() { var str = $(this).val(); $(this).val(repostal(str)); $(this).valid(); }); $('input[name="tel_mobile"]').on('blur', function() { var str = $(this).val(); $(this).val(repostal(str)); $(this).valid(); }); $('input[name="emg_number"]').on('blur', function() { var str = $(this).val(); $(this).val(repostal(str)); $(this).valid(); });*/ }); $('input[name="plan"]').on('click', function(){ var $checkbox = $('input[type="checkbox"]'); $checkbox.removeAttr('checked').prop('checked', false).change(); }); //支払方法変更で注意事項書き換え $(".hide").hide(); $('input[name="f_paytype"]').on('change', function () { if($(this).val() === 'M'){ $("#notes_credit").slideDown(); $("#notes_bank").slideUp(); }else{ $("#notes_bank").slideDown(); $("#notes_credit").slideUp(); } }); //法人選択でプライバシーポリシーチェックリセット $('input[name="corp"]').on('change', function () { var $checkbox = $('input[type="checkbox"]'); $checkbox.removeAttr('checked').prop('checked', false).change(); });