// /** // *smartRollover // **/ // function smartRollover() { // if(document.getElementsByTagName) { // var images = document.getElementsByTagName("img"); // for(var i=0; i < images.length; i++) { // if(images[i].getAttribute("src").match("_off.")) // { // images[i].onmouseover = function() { // this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on.")); // } // images[i].onmouseout = function() { // this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off.")); // } // } // } // } // } // if (window.addEventListener) { // window.addEventListener("load", smartRollover, false); // } else if (window.attachEvent) { // window.attachEvent("onload", smartRollover); // } /** * Flatten height same as the highest element for each row. * * Copyright (c) 2011 Hayato Takenaka * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * @author: Hayato Takenaka (http://urin.take-uma.net) * @version: 0.0.2 **/ (function ($) { $.fn.tile = function (columns) { var tiles, max, c, h, last = this.length - 1, s; if (!columns) columns = this.length; this.each(function () { s = this.style; if (s.removeProperty) s.removeProperty("height"); if (s.removeAttribute) s.removeAttribute("height"); }); return this.each(function (i) { c = i % columns; if (c == 0) tiles = []; tiles[c] = $(this); h = tiles[c].height(); if (c == 0 || h > max) max = h; if (i == last || c == columns - 1) $.each(tiles, function () { this.height(max); }); }); }; })(jQuery); /** *windowopen **/ $(document).ready(function () { $(".blank").click(function () { window.open(this.href, "_blank"); return false; }); }); /** * navi_animation **/ //讓ェ譁ケ蜷代↓荳ヲ繧薙□騾」逡ェ縺ョ逕サ蜒上r繧「繝九Γ繝シ繧キ繝ァ繝ウ縺輔○縺セ縺吶€� (function ($) { $.fn["sequentialAnimation"] = function (imgWidth, numImgs, options) { var myself = $(this); var count = 0; var defaultValue = { fps: 30, callback: function () {}, }; var settings = $.extend(defaultValue, options); interval = setInterval(doInterval, Math.ceil(1000 / settings.fps)); function doInterval() { count++; if (count >= numImgs) count = 0; myself.css("background-position", -imgWidth * count + "px 0"); } return this; }; })(jQuery); var interval; $(document).ready(function () { $("#header ul li.about a").hover( function () { $(this).sequentialAnimation(200, 10, { fps: 30, }); }, function () { clearInterval(interval); $(this).css("background-position", -200 * 1 + "px 0"); } ); $("#header ul li.course a").hover( function () { $(this).sequentialAnimation(200, 10, { fps: 30, }); }, function () { clearInterval(interval); $(this).css("background-position", -200 * 1 + "px 0"); } ); $("#header ul li.qa a").hover( function () { $(this).sequentialAnimation(200, 10, { fps: 30, }); }, function () { clearInterval(interval); $(this).css("background-position", -200 * 1 + "px 0"); } ); $("#header ul li.access a").hover( function () { $(this).sequentialAnimation(200, 10, { fps: 30, }); }, function () { clearInterval(interval); $(this).css("background-position", -200 * 1 + "px 0"); } ); $("#header ul li.reserve a").hover( function () { $(this).sequentialAnimation(220, 10, { fps: 30, }); }, function () { clearInterval(interval); $(this).css("background-position", -220 * 1 + "px 0"); } ); $(".tab").each(function () { const $tab = $(this); const $parentContainer = $tab.parent(); // Get the common parent container const $tabItems = $tab.find(".tab__item"); const $contents = $parentContainer.find(".main__content"); // Select only the main__content within the same container // Hide all contents and remove active class by default $contents.hide().removeClass("active"); // Show content and add active class associated with the currently active tab if ($tabItems.filter(".--kumamoto").hasClass("active")) { $contents .filter( // '[data-js^="visit-kumamoto"], [data-js^="map-kumamoto"], [data-js^="about-kumamoto"], [data-js^="course-kumamoto"]' '[data-js*="-kumamoto"]' ) .show() .addClass("active"); } else if ($tabItems.filter(".--omura").hasClass("active")) { $contents .filter( // '[data-js^="visit-omura"], [data-js^="map-omura"], [data-js^="about-omura"], [data-js^="course-omura"]' '[data-js*="-omura"]' ) .show() .addClass("active"); } $tabItems.click(function () { $tabItems.removeClass("active"); $(this).addClass("active"); // Hide all contents and remove active class $contents.hide().removeClass("active"); // Show content and add active class for the selected tab if ($(this).hasClass("--kumamoto")) { $contents .filter( // '[data-js^="visit-kumamoto"], [data-js^="map-kumamoto"], [data-js^="about-kumamoto"], [data-js^="course-kumamoto"]' '[data-js*="-kumamoto"]' ) .show() .addClass("active"); } else if ($(this).hasClass("--omura")) { $contents .filter( // '[data-js^="visit-omura"], [data-js^="map-omura"], [data-js^="about-omura"], [data-js^="course-omura"]' '[data-js*="-omura"]' ) .show() .addClass("active"); } }); }); $(".dropbtn").click(function (event) { event.stopPropagation(); $(".dropdown-content").toggleClass("show"); }); // $(".dropdown-content button").click(function () { $("[data-js='reserve']").click(function (e) { e.preventDefault(); // Open the modal $(".modal").addClass("show"); }); $(".modal .cancel-btn").click(function () { // Close the modal $(".modal").removeClass("show"); }); $(".modal .accept-btn").click(function () { window.location.href = "/company/esg/kengakutai/reserve/index.html"; }); $(document).click(function () { $(".dropdown-content").removeClass("show"); }); });