PageSourceSearch

https://banzai-pollo.com/wp-content/themes/theme001_re/js/common.js

js banzai-pollo.com collected 2026-10-08 07:20:18 UTC 1,469 bytes, 38 lines download raw bytes

1// トップへ戻るボタン
2//スクロールした際の動きを関数でまとめる
3function PageTopAnime() {
4	var scroll = window.pageYOffset
5	if (scroll >= 200) {
6		// 上から200pxスクロールしたら
7		document.querySelector('#page-top').classList.remove('RightMove') // #page-topについているRightMoveというクラス名を除く
8		document.querySelector('#page-top').classList.add('LeftMove') // #page-topについているLeftMoveというクラス名を付与
9	} else {
10		if (document.querySelector('#page-top').classList.contains('LeftMove')) {
11			// すでに#page-topにLeftMoveというクラス名がついていたら
12			document.querySelector('#page-top').classList.remove('LeftMove') // LeftMoveというクラス名を除き
13			document.querySelector('#page-top').classList.add('RightMove') // RightMoveというクラス名を#page-topに付与
14		}
15	}
16}
17
18// 画面をスクロールをしたら動かしたい場合の記述
19window.addEventListener('scroll', function () {
20	PageTopAnime() /* スクロールした際の動きの関数を呼ぶ*/
21})
22
23// #page-topをクリックした際の設定
24document.addEventListener('DOMContentLoaded', () => {
25	const topElement = document.querySelector('#top')
26
27	if (topElement) {
28		topElement.addEventListener('click', function (e) {
29			e.preventDefault()
30			window.scrollTo({
31				top: 0,
32				behavior: 'smooth',
33			})
34		})
35	} else {
36		console.error("Element with ID 'top' not found")
37	}
38})

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.