// var mySwiper = new Swiper('#frontpage .swiper-container', { // loop: true, // autoplay:4500, // speed: 1700, // effect: 'fade', // // pagination: '.swiper-pagination', // // nextButton: '.swiper-button-next', // // prevButton: '.swiper-button-prev', // }) jQuery(function(){ var mySwiperAnim = function() { var el1 = document.querySelector('.swiper-wrapper .swiper-slide-active .swiper-img.display-sp'); var el2 = document.querySelector('.swiper-wrapper .swiper-slide-active .swiper-img.display-pc'); var anim = document.querySelectorAll('.is-anim'); for (var i = 0; i < anim.length; i++ ) { anim[i].classList.remove('is-anim'); } el1.classList.add('is-anim'); el2.classList.add('is-anim'); }; // window.addEventListener('DOMContentLoaded', function() { var swiper01 = new Swiper('#frontpage .swiper-container', { autoplay:5500, autoplayDisableOnInteraction: false, noSwiping: true, noSwipingClass: 'swiper-slide', speed: 1700, effect: 'fade', loop: true, onInit: function(i) { mySwiperAnim(); }, onSlideChangeEnd: function(i) { mySwiperAnim(); } }); // }, false); var windowWidth = window.innerWidth; // ブラウザ幅を取得 var countup_flg = 0; // if( 992 > windowWidth){ /* *************************************************************************************** * スマホの処理 *************************************************************************************** */ var stopScroll = function( event ){ // スクロール停止用 for iOS event.preventDefault(); } /* グロナビ */ jQuery('#nav_toggle').click(function(){ // ハンバーガーアイコンがタップされたら var headerHeight = jQuery('.l-header-inner').innerHeight(); jQuery('.l-header').toggleClass('open'); // openクラスを付与しハンバーガーアイコンのアニメーション制御 jQuery('.l-nav-menu').stop().fadeToggle(600); // グロナビを表示制御 if (jQuery('.l-header').hasClass('open')) { // OPEN var url = location.href; if(url == "https://aka-yokohama.com/"){ jQuery('.l-header-full').css('background', 'url(https://aka-yokohama.com/wp-content/themes/aka/img/l-header-inner_bg.jpg)'); // グロナビの背景設定 } jQuery('.l-header-full').css('height', headerHeight); jQuery('.l-nav-menu').css('top', headerHeight); jQuery('.l-header').css({'overflow-y':'hidden','position':'fixed','top':'0','z-index':'99'}); // スクロールを停止する jQuery('.globalNav > ul').css('height','calc(100vh - ' + headerHeight + 'px)'); // window.addEventListener( 'touchmove' , stopScroll , { passive: false } ); // スクロールを停止する for iOS jQuery('.l-wrapper').on('touchmove.scroll', function(event) {event.preventDefault();}); } else { // CLOSE jQuery('.l-header-full').css('background', 'none'); // グロナビの背景削除 jQuery('.l-header').css({'overflow-y':'unset','position':'static','z-index':'0'}); // スクロールの停止を解除 //window.removeEventListener( 'touchmove' , stopScroll, { passive: false } );// スクロールの停止を解除 for iOS jQuery('.l-wrapper').off('touchmove.scroll'); } }); jQuery(window).on('load resize', function(){ var headerHeight = jQuery('.l-header-inner').innerHeight(); // ヘッダーの高さを取得 // jQuery('#subpage .l-nav-menu').css('top', headerHeight - 1 + 'px'); // グロナビ アコーディオンの開始位置を指定 // jQuery('#subpage .l-header-full, #subpage l-header').css('height', headerHeight + 'px'); jQuery('.l-header-full').css('height', headerHeight); var resizeWidth = window.innerWidth; if( 992 <= resizeWidth){ jQuery('.l-header').css({'overflow-y':'unset','position':'relative'}); jQuery('.l-header-full').css('background', 'none'); jQuery('.l-nav-menu').css('top', '-46px'); jQuery('.globalNav > ul').css('height','auto'); } else { jQuery('.l-nav-menu').css('top', '74px'); } }); // } else { /* *************************************************************************************** * PCの処理 *************************************************************************************** */ /* グロナビ hover時に2階層目表示 */ jQuery('.drop').hover(function(){ jQuery(this).find('ul').stop().slideDown(); }, function(){ jQuery(this).find('ul').stop().slideUp(); }); // } jQuery('a[href^="#"]').click(function(event) { var speed = 400; var href= jQuery(this).attr("href"); var target = jQuery(href == "#" || href == "" ? 'html' : href); var position = target.offset().top; jQuery('body,html').animate({scrollTop:position}, speed, 'swing'); return false; }); var startPos = 0, scroll = 0; var userAgent = window.navigator.userAgent.toLowerCase(); jQuery(window).on('scroll load', function(){ if( 992 > windowWidth){ // SP var look = 30; } else { // PC var look = 70; } jQuery('.fadein').each(function(){ var elemPos = jQuery(this).offset().top; var scroll = jQuery(window).scrollTop(); var windowHeight = jQuery(window).height(); if (scroll > elemPos - windowHeight + look){ jQuery(this).addClass('scrollin'); if(jQuery(this).hasClass('c-distributionArea-box')){ countup(); countup_flg = 1; } } }); /////////////////////////////////////////////////////////////////////// totopボタン var jQuerytotopBtn = jQuery('.l-page-top'); // totopボタン var scroll = jQuery(window).scrollTop(); // スクロール量(0から) var scrollPosition = jQuery(window).height() + scroll; // スクロール量(=ブラウザの高さ + スクロール量(0から)) var pageHeight = jQuery('body').innerHeight(); // ページ全体の高さ var footHeight = jQuery('footer').innerHeight(); // footerの高さ(=止めたい位置) var btnHeight= jQuerytotopBtn.innerHeight(); // totopボタンの高さ var footerArea = pageHeight - footHeight; // フッター開始位置(ページの高さ - フッターの高さ) if (scroll <= 150 ){ // スクロール量が150以内なら jQuerytotopBtn.fadeOut(); } else if (footerArea <= scrollPosition) { // スクロール量がフッター開始位置以上になったら jQuerytotopBtn.css({ 'display' : 'block', 'position' : 'absolute', 'bottom': footHeight - btnHeight }); } else { // スクロール量が150~フッター開始位置以内 if (userAgent.indexOf("trident/7.0") > -1) { jQuerytotopBtn.css({ 'display' : 'block', // 'bottom': '20px', 'bottom': '0px', 'position':'fixed' }); } else { if (scroll >= startPos) { jQuerytotopBtn.css({ 'display' : 'none', // 'bottom': '20px', 'bottom': '0px', 'position':'fixed' }); } else { if(jQuery('body').hasClass('price-area') && jQuery('#price-disp').hasClass('open')) { var topBtnP = jQuery('#price-disp').outerHeight(); jQuerytotopBtn.css({ 'display' : 'block', // 'bottom': '20px', 'bottom': topBtnP + 'px', 'position':'fixed', 'opacity':'0.7' }); } else { jQuerytotopBtn.css({ 'display' : 'block', // 'bottom': '20px', 'bottom': '0px', 'position':'fixed', 'opacity':'1' }); } } } } startPos = scroll; }); /////////////////////////////////// 猫アニメーション jQuery('.cat').each(function(index){ var width = jQuery('.c-distributionArea-bg').innerWidth() - 50; var height = jQuery('.c-distributionArea-bg').height() - 40; var left = 50 + Math.floor(Math.random() * width); var top = 40 + Math.floor(Math.random() * height); var index = index+1; jQuery('.cat_'+index).css({left:left+'px',top:top+'px'}); }) cat(); function cat(){ var width = jQuery('.c-distributionArea-bg').innerWidth() - 50; var height = jQuery('.c-distributionArea-bg').height() - 40; jQuery('.cat').each(function(index){ var left = 50 + Math.floor(Math.random() * width); var top = 40 + Math.floor(Math.random() * height); var index = index+1; var muth = 18000 + Math.floor(Math.random() * 30000); jQuery('.cat_'+index).animate({left:left+'px',top:top+'px'}, muth); }) setTimeout(cat,10000) } setInterval(cat,10000); /* トップページ「ポスティング配布目標」カウントアップ*/ function countup() { if (countup_flg == '0') { jQuery('.count').each(function () { jQuery(this).prop('c',0).animate({ c: jQuery(this).text() },{ duration: 1500, easing: 'linear', step: function (now) { jQuery(this).text(Math.ceil(now).toLocaleString()); } }); }); } } if(jQuery('body').hasClass('price-area')) { // if (document.referrer == 'https://aka-yokohama.com/inquiry-estimate/'){ // document.location.reload() // } // jQuery(window).load(function(){ // console.log('7777'); //window.location.reload(); // }); var jQuerypriceList = jQuery('#price-list'), jQuerypriceBtn = jQuery('#priceBtn'), jQuerypaperSize = jQuery('#paper-size'), size = jQuery('#size').val(); // 選択した紙のサイズを取得 //calcFlg = 0; calcPrice(); jQuery('#price_submit').prop('disabled',true); var price_submit_flg = 0; jQuery('.total-btn').on("click", function(){ if (jQuery('#price_submit').prop('disabled') != false){ jQuery('#price_submit').removeClass('cursor-change'); jQuery('#price_submit').addClass('blinking'); // setTimeout("jQuery('#price_submit').removeClass('blinking')", 2800); // setTimeout("jQuery('#price_submit').removeClass('blinking')", 6860); setTimeout("jQuery('#price_submit').removeClass('blinking')", 8850); jQuery('#price_submit').removeClass('transparent'); jQuery('#price_submit').prop('disabled',false); } size = jQuery('#size').val(); calcPrice(); if(!jQuerypriceList.hasClass('open')) { jQuerypriceList.stop().addClass('open'); jQuerypriceList.stop().fadeIn(); getPoint(); jQuery('#price-disp').hide(); } jQuery("html,body").animate({scrollTop:jQuerypriceBtn.offset().top}); }); jQuery('.area-list input, .ctl-select select').on("change", function(){ jQuerypaperSize = jQuery('#paper-size'), size = jQuery('#size').val(); // 選択した紙のサイズを取得 calcPrice(); }); function calcPrice() { // 選択したサイズの単価取得 + お見積り結果の「紙のサイズ」の値を変更 jQuerypaperSize.empty(); if (size == 'A3') { jQuerypaperSize.append('A3(297 × 420mm)'); var price_k = data['A3_k']; price_z = data['A3_z']; price_s = data['A3_s']; } else if (size == 'A4') { jQuerypaperSize.append('A4(210 × 297mm)'); var price_k = data['A4_k']; price_z = data['A4_z']; price_s = data['A4_s']; } else if (size == 'A5') { jQuerypaperSize.append('A5(148 × 210mm)'); var price_k = data['A5_k']; price_z = data['A5_z']; price_s = data['A5_s']; } else if (size == 'B3') { jQuerypaperSize.append('B3(364 × 515mm)'); var price_k = data['B3_k']; price_z = data['B3_z']; price_s = data['B3_s']; } else if (size == 'B4') { jQuerypaperSize.append('B4(257 × 364mm)'); var price_k = data['B4_k']; price_z = data['B4_z']; price_s = data['B4_s']; } else if (size == 'B5') { jQuerypaperSize.append('B5(182 × 257mm)'); var price_k = data['B5_k']; price_z = data['B5_z']; price_s = data['B5_s']; } else { jQuerypaperSize.append('A3(297 × 420mm)'); var price_k = data['A3_k']; price_z = data['A3_z']; price_s = data['A3_s']; } document.getElementById("size").selectedIndex = sessionStorage.getItem('selectNo'); // 各エリアの配布枚数を取得(※チェックされたエリアのみ) var total_z = Number(0), total_k = Number(0), total_s = Number(0); jQuery('.amount_z').each(function() { var result = jQuery(this).prevAll('#starPoint .check_flg').children('input').prop('checked'); if(result) { total_z = total_z + Number(jQuery(this).text()); } }); jQuery('.amount_k').each(function() { var result = jQuery(this).prevAll('#starPoint .check_flg').children('input').prop('checked'); if(result) { total_k = total_k + Number(jQuery(this).text()); } }); jQuery('.amount_s').each(function() { var result = jQuery(this).prevAll('#starPoint .check_flg').children('input').prop('checked'); if(result) { total_s = total_s + Number(jQuery(this).text()); } }); // お見積り結果に料金を表示 var zYen = (total_z * price_z).toLocaleString() + '円', kYen = (total_k * price_k).toLocaleString() + '円', sYen = (total_s * price_s).toLocaleString() + '円', zSheet = total_z.toLocaleString() + '枚', kSheet = total_k.toLocaleString() + '枚', sSheet = total_s.toLocaleString() + '枚'; jQuery('#price-z').html(zYen); jQuery('#price-k').html(kYen); jQuery('#price-s').html(sYen); jQuery('#sum-z, #total-z').html(zSheet); jQuery('#sum-k, #total-k').html(kSheet); jQuery('#sum-s, #total-s').html(sSheet); jQuery('#setEstimate input[name="z_price"]').val(zYen); jQuery('#setEstimate input[name="k_price"]').val(kYen); jQuery('#setEstimate input[name="s_price"]').val(sYen); jQuery('#setEstimate input[name="z_total"]').val(zSheet); jQuery('#setEstimate input[name="k_total"]').val(kSheet); jQuery('#setEstimate input[name="s_total"]').val(sSheet); jQuery('#setEstimate input[name="size"]').val(jQuery('#size').val()); // 選択したエリアを取得 var arrayGroup = ''; jQuery('#starPoint .area-list_table_inner tr').each(function(index) { if (jQuery(this).children('.pt_area').text() !== '地域名') { if(jQuery(this).children('.check_flg').children('input').prop('checked')) { var checkFlg = 1; } else { var checkFlg = 0; } var arrayItem = [ checkFlg, jQuery(this).children('.pt_area').text(), jQuery(this).children('.amount_z').text(), jQuery(this).children('.amount_k').text(), jQuery(this).children('.amount_s').text() ] //arrayGroup.push(arrayItem); arrayGroup += arrayItem + '|'; } }); arrayGroup = arrayGroup.slice(0, -1); jQuery('#setEstimate input[name="selected_town"]').val(arrayGroup); /*** 印刷画面のテーブル作成 ここから ***/ // 選択したエリアのtr以下を取得 var addArea = []; jQuery('#starPoint .check_flg input').each(function() { if(jQuery(this).prop('checked')) { // console.log(jQuery(this).closest('tr').html()); // var test = jQuery(this).closest('tr'); // test.find('.price_checkbox').remove(); // console.log(test.html()); addArea.push('
選択 | 地域名 | 全戸配布 予定数 | 戸建配布 予定数 | 集合配布 予定数 |
---|
選択 | 地域名 | 全戸配布 予定数 | 戸建配布 予定数 | 集合配布 予定数 |
---|