news

', nextArrow: '
', dots: true, pauseOnFocus: false, pauseOnHover: false, customPaging: function(slider, i) { const thumb = $(slider.$slides[i]).data(); return ''; }, }); // 高さ揃え function arrow_hgt_adjust() { slide.each(function() { var img_hgt = $(this).find('.img').height(), arrow = $(this).find('.slick-arrow'); arrow.height(img_hgt); }); } arrow_hgt_adjust(); $(window).resize(function() { arrow_hgt_adjust(); }); // 1枚のとき slide.each(function() { var img_lgt = $(this).find('.img').length; if (img_lgt == 1) { $(this).find('.slick-dots').remove(); } }); /* Loopsコンテンツ:2~4カラムの高さ揃え ********************************************** */ if (wid > 767) { $('.lps_parts--column:not(.column-1) .column_item').each(function() { var itemHgt = $(this).height(); imgHgt = $(this).find('.img').outerHeight(); text = $(this).find('.text'); textHgt = itemHgt - imgHgt; text.css('height', textHgt); }); } /* テーブル ********************************************** */ $('.mce-content-body .table-sp-scroll').each(function() { const mce_content_body_width = $(this).closest('.mce-content-body').width(), tableWidth = $(this).find('tbody').width(); if (mce_content_body_width < tableWidth - 2) { $(this).wrap('
'); $(this).closest('.scroll').before('

横にスクロールできます→

'); } }); $('.mce-content-body table:not(.table-sp-scroll)').each(function() { const mce_content_body_width = $(this).closest('.mce-content-body').width(), tableWidth = $(this).find('tbody').width(); if (mce_content_body_width < tableWidth - 2) { $(this).css('width', '100%'); } }); /* iframe対応 ********************************************** */ $('.mce-content-body iframe').each(function() { const string = $(this).attr('src'), google_map = 'https://www.google.com/', youtube = 'https://www.youtube.com/'; if (string.indexOf(google_map) > -1) { $(this).wrap('
'); } if (string.indexOf(youtube) > -1) { $(this).wrap('
'); } }); /* alt ********************************************** */ $('.mce-content-body img[alt=""], .lps_sec img[alt=""]').each(function() { let alt = '技術情報 |1 |お知らせ|大日コンサルタント株式会社'; $(this).attr('alt', alt); }); /* YouTube関連動画非表示 ********************************************** */ $('iframe[src^="https://www.youtube.com/embed/"]').each(function() { let src = $(this).attr('src'); if (src.match(/\?feature=oembed/)) { src = src.replace('?feature=oembed', ''); } let regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/; match = src.match(regExp), id = match[2]; if (match && id.length == 11) { let new_src = src + '?loop=1&playlist=' + id; $(this).attr('src', new_src); } }); /* no_link ********************************************** */ $('a[href*="no_link"]').attr('href', 'javascript:void(0);'); /* リンクを別タブで開く ********************************************** */ $('a[target="_blank"],a[href^="http"]:not([href*="' + location.hostname + '"]),a[href*="/contact/corporate"],a[href*="/contact/technology"], a[href$=".pdf"]:not(.cv),.btn a[href$=".jpg"],.btn a[href$=".png"]').attr({ 'target': '_blank', 'rel': 'noopener noreferrer' }).append(''); $('a[href^="http"]:not([href*="' + location.hostname + '"])').attr({ 'target': '_blank', 'rel': 'noopener noreferrer nofollow' }); /* ボタン処理 ********************************************** */ if (wid > 1080) { $.fn.letterSpan = function() { $(this).each(function() { const text = $(this).text().trim(); let lineResult = ''; text.split('').forEach(function(letter, i) { const n = i / 20; lineResult += '' + letter + ''; }); this.innerHTML = lineResult; }); }; $('.btn span').letterSpan(); } /* 文字分割 ********************************************** */ $.fn.letterLine = function() { $(this).each(function() { const text = $(this).html().trim(); let result = ''; text.split('
').forEach(function(line) { result += '

' + line + '

'; }); this.innerHTML = result; }); }; $('.js-txt-line').letterLine(); /* toggle ********************************************** */ $('.toggle:not(:first-child)').next().hide(); $('.toggle').on('click', function() { $(this).toggleClass('open').next().stop().slideToggle(); }); if (wid < 767) { $('.toggle-fnav_sub').on('click', function() { $(this).toggleClass('open').parents().siblings('.fnav_sub--wrap').stop().slideToggle(); }); } /* click時にactiveをtoggle処理 ********************************************** */ $archive_list = '.archive_list--ttl,.archive_list'; $($archive_list).on('click', function() { $(this).toggleClass('active'); $(this).siblings('.archive_month').stop().slideToggle(400); }); }); $(window).on('load', function() { });