PageSourceSearch

https://nabi.ac.jp/wp-content/themes/nabi-2018/js/accordion-min.js?1

js nabi.ac.jp collected 2026-10-02 20:46:24 UTC 2,558 bytes, 62 lines download raw bytes

1/*
2 * 
3 * Accordion - A simple accordion group for most use cases.
4 * Version 0.1
5 * @requires jQuery v1.5
6 * 
7 * Copyright (c) 2014 Ajay Kumar Yadav
8 * Published for free use under MIT license:
9 * http://www.opensource.org/licenses/mit-license.php
10 */
11!function(t){t.fn.accordion=function(n){var a={tabClick:".topWrap",tabContent:".details",accordAnimation:1e3,bodyAnimation:1e3,spaceTop:0,delay:0,closeOther:!1},e=null,o=t.extend({},a,n);t(o.tabContent).hide();var e=null,i=function(){t("li").each(function(){var n=t(this).hasClass("active");1==n&&(t(this).removeClass("active"),e=parseInt(t(this).outerHeight()),t(o.tabContent).slideUp(2*o.accordAnimation))})};t(document).on("click",o.tabClick,function(){var n=t(this),a=n.siblings(o.tabContent).css("display"),s=n.siblings(o.tabContent),c=n.parent("li"),l=n.offset().top;"block"==a?(s.slideUp(parseInt(o.accordAnimation)),c.removeClass("active")):(1==o.closeOther&&(console.log("close"),i()),n.siblings(o.tabContent).slideToggle(parseInt(o.accordAnimation)),"none"!=a?c.removeClass("active"):c.addClass("active"),t("html,body").animate({scrollTop:l-e-o.spaceTop},parseInt(o.bodyAnimation)))})}}(window.jQuery);
12
13
14
15
16
17
18
19
20
21
22
23
24
25// .s_06 .accordion_one
26$(function(){
27  //.accordion_oneの中の.accordion_headerがクリックされたら
28  $('.s_06 .accordion_one .accordion_header').click(function(){
29    //クリックされた.accordion_oneの中の.accordion_headerに隣接する.accordion_innerが開いたり閉じたりする。
30    $(this).next('.accordion_inner').slideToggle();
31    $(this).toggleClass("open");
32     
33  });
34  //閉じるボタンがクリックされたら
35  $('a.close_btn').click(function () {
36    //クリックされたa.close_btnの親要素の.accordion_oneの.accordion_innerを閉じる。
37    $(this).parents('.s_06 .accordion_one .accordion_inner').slideUp();
38    $('.s_06 .accordion_one .accordion_header').removeClass("open");
39  });
40});
41
42// ページ内リンク
43$(function(){
44  // 閉じるボタンをクリックした場合に処理
45  $('.s_06 a.close_btn').click(function() {
46    // 移動先を0px上にずらす
47    var adjust = 0;
48    // スクロールの速度
49    var speed = 500; // ミリ秒
50    // アンカーの値取得
51    var href= $(this).attr("href");
52    // 移動先を取得
53    var target = $(href == "#" || href == "" ? 'html' : href);
54    // 移動先を調整
55    var position = target.offset().top - adjust;
56    // スムーススクロール
57    $('body,html').animate({scrollTop:position}, speed, 'swing');
58    return false;
59  });
60});
61
62

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.