PageSourceSearch

https://www.shimane-u.ac.jp/_themes/ud/common/js/jquery.pagescroll.js

js shimane-u.ac.jp collected 2026-10-01 10:19:36 UTC 1,596 bytes, 63 lines download raw bytes

1/**
2 * pageScroll jQuery Plugin
3 *   v1.0
4 *  (c)2014 RESTEP
5 *  http://restep.jp/
6 */
7/***********************************************************
8$('#id').pageScroll({
9	'duration': アニメーション時間,
10	'easing': イージングの種類,
11	'dummy_class': ダミーで挿入するdivのクラス名
12});
13***********************************************************/
14(function($) {
15	$.fn.pageScroll = function(args) {
16		var defaults = {
17			'duration': 500,
18			'easing': 'swing',
19			'dummy_class': 'pagescroll-dummy'
20		};
21		this.settings = $.extend(defaults, args);
22		var _this = this;
23		
24		//
25		// 初期化
26		//
27		this.init = function() {
28			// 戻るボタン対策(ダミーdivを追加)
29			$('body').append($('<div>').addClass(_this.settings.dummy_class).css({
30				width: '1px',
31				height: '1px',
32				position: 'absolute',
33				left: 0,
34				top: 0
35			}));
36
37			// マウスクリック時の制御
38			$('a.pagescroll[href^=#]').on('click', function() {
39				var target = $(this).attr('href');
40				var	dummy_target = target.substr(1, target.length-1) + (new Date() * 1);
41
42				// 戻るボタン対策
43				$('.'+_this.settings.dummy_class).attr(
44					'id', dummy_target
45				).css(
46					'top', jQuery(window).scrollTop()
47				);
48				document.location.hash = '#' + dummy_target;
49
50				// スクロール
51				$('html, body').animate({
52					scrollTop: $(target).offset().top
53				}, {
54					duration: _this.settings.duration,
55					easing: _this.settings.easing
56				});
57
58				return false;
59			});
60		};
61		this.init();
62	};
63})(jQuery);

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.