PageSourceSearch

https://www.dharmadrum.org/script/template.js

js dharmadrum.org collected 2026-10-02 10:45:01 UTC 3,772 bytes, 130 lines download raw bytes

1$(document).ready(function() {
2	// $(".inline").colorbox({ inline: true, width: "auto" }); //html燈箱
3    rwd_fun();
4    $(window).resize(rwd_fun);
5
6    $("header").after($("#h-menu"));
7
8    $("#wrapper").attr("style","background-image: url(images/allbackground.jpg)");
9
10    $("a[data-rel^=lightcase]").lightcase({ swipe: true, showSequenceInfo: false });
11
12});
13
14function rwd_fun() {
15    var width = $(window).innerWidth();
16    var height = $(window).innerHeight();
17    if (width >= 1280) {
18        $(".p-N_img").before($(".p-N_word"));
19        $(".p-MV_img").before($(".p-MV_word"));
20    }
21    else {
22        $(".p-N_img").after($(".p-N_word"));
23        $(".p-MV_img").after($(".p-MV_word"));
24    }
25}
26
27// $(document).ready(function() {
28
29//     $(window).scroll(function() {
30//         var scrollVal = $(this).scrollTop();
31//         if (scrollVal >= 145) {
32//             $("header").addClass("menu_top1");
33//         } else {
34//             $("header").removeClass("menu_top1");
35//         }
36//     });
37//     // $(window).scroll(function() {
38//     //     var scrollVal = $(this).scrollTop();
39//     //     if (scrollVal >= 120) {
40//     //         $("header").addClass("menu_top1");
41//     //     }
42//     //     if (scrollVal >= 150) {
43//     //         $("header").addClass("menu_top2");
44//     //     } else {
45//     //         $("header").removeClass("menu_top1 menu_top2");
46//     //     }
47//     // });
48// });
49
50// 首頁頁籤
51function openPage(pageName,elmnt,area) {
52	var i, tabcontent, tablinks;
53	tabcontent = document.getElementsByClassName("i-tabcontent");
54	for (i = 0; i < tabcontent.length; i++) {
55		tabcontent[i].style.display = "none";
56	}
57	tablinks = document.getElementsByClassName("i-tablink");
58	for (i = 0; i < tablinks.length; i++) {
59		tablinks[i].style.backgroundColor = "";
60	}
61	document.getElementById(pageName).style.display = "block";
62	elmnt.style.backgroundColor = area;
63}
64
65window.onload = function(){
66    document.getElementById("defaultOpen").click();
67}
68
69// 手機收合選單
70$(document).ready(function () {
71    let burger = document.getElementById('h-burger'),
72         nav    = document.getElementById('h-main-nav');
73
74    burger.addEventListener('click', function(){
75        this.classList.toggle('h-is-open');
76        nav.classList.toggle('h-is-open');
77    });
78});
79
80// 語系選擇
81function myFunction() {
82    document.getElementById("h-myDropdown").classList.toggle("show");
83}
84
85window.onclick = function(event) {
86    if (!event.target.matches('.h-dropbtn')) {
87    var dropdowns = document.getElementsByClassName("h-dropdown-content");
88        var i;
89        for (i = 0; i < dropdowns.length; i++) {
90            var openDropdown = dropdowns[i];
91            if (openDropdown.classList.contains('show')) {
92                openDropdown.classList.remove('show');
93            }
94        }
95    }
96}
97
98//側邊選單第二層
99$(document).ready(function () {
100    var coll = document.getElementsByClassName("p-N_sideMenu");
101    var i;
102
103    for (i = 0; i < coll.length; i++) {
104        coll[i].addEventListener("click", function() {
105        this.classList.toggle("open");
106        var collapsibleCnt = this.nextElementSibling;
107        if (collapsibleCnt.style.maxHeight){
108            collapsibleCnt.style.maxHeight = null;
109        } else {
110            collapsibleCnt.style.maxHeight = collapsibleCnt.scrollHeight + "px";
111        } 
112        });
113    }
114});
115
116// 置頂按鈕
117window.onscroll = function() {scrollFunction()};
118
119function scrollFunction() {
120  if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
121     document.getElementById("go2Top").style.display = "block";
122  } else {
123     document.getElementById("go2Top").style.display = "none";
124  }
125}
126
127function topFunction() {
128  $('html,body').animate({ scrollTop: 0 }, 1000);
129}
130

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.