PageSourceSearch

https://kawashima-group.com/wp/wp-content/themes/original/js/smoothScrollEx.js

js kawashima-group.com collected 2026-10-02 23:31:29 UTC 3,380 bytes, 143 lines download raw bytes

1/**
2* smoothScrollEx Plugin ver1.1
3*
4* 2015 Jun Sato http://creator-index.com/
5*
6* MIT-style license.
7*
8http://creator-index.com/2015/03/870/
9*/
10	
11		
12;(function($) {
13	$(window).load(function(){
14			
15		var options = $.extend({
16			
17			scrollSpeed: 500,  //ƒXƒNƒ[ƒ‹‚·‚鑬‚³iƒ~ƒŠ•bj
18			easing: 'swing',  //ƒC[ƒWƒ“ƒOiƒAƒjƒ[ƒVƒ‡ƒ“‚Ì‹““®j¦—vƒC[ƒWƒ“ƒOƒvƒ‰ƒOƒCƒ“
19//			adjustment: -100, //ˆÚ“®Š®—¹Žž‚̃EƒBƒ“ƒhƒEˆÊ’u‚Ì’²®’l
20			delayTime: 300 //‘Ò‹@ŽžŠÔiƒ~ƒŠ•bj¦‘JˆÚ‚·‚鎞‚Ì‚Ý
21		
22			},options);
23
24//ƒEƒBƒ“ƒhƒEƒTƒCƒY‚ð”»’è‚ð‚µ‚ÄAˆÚ“®Š®—¹Žž‚̃EƒBƒ“ƒhƒEˆÊ’u‚Ì’²®’l‚ð•ύX
25    var w = $(window).width();
26    var x = 736;
27    if (w <= x) {		// ƒXƒ}ƒzŽž‚̏ˆ—
28      var options = $.extend({ adjustment: -60 },options); //ˆÚ“®Š®—¹Žž‚̃EƒBƒ“ƒhƒEˆÊ’u‚Ì’²®’l
29    } else {   // ‚o‚bŽž‚̏ˆ—
30     	var options = $.extend({ adjustment: -150 },options); //ˆÚ“®Š®—¹Žž‚̃EƒBƒ“ƒhƒEˆÊ’u‚Ì’²®’l
31    }
32
33
34
35//ƒXƒNƒ[ƒ‹‚ª100‚É’B‚µ‚½‚çƒ{ƒ^ƒ“•\ަ-----------
36    var topBtn = $('#pagetop');   
37    topBtn.hide();
38    //ƒXƒNƒ[ƒ‹‚ª100‚É’B‚µ‚½‚çƒ{ƒ^ƒ“•\ަ
39    $(window).scroll(function () {
40        if ($(this).scrollTop() > 100) {
41            topBtn.fadeIn();
42        } else {
43            topBtn.fadeOut();
44        }
45				return false;
46		 });
47
48
49
50
51
52
53		$('[href*=#]').click(function(event){
54			var element = $(this);
55			var elementHref = element.attr('href');
56			
57			
58			if(elementHref.search(/^#.+/) === 0){
59			
60				var targetId = elementHref;
61				var targetY = $(targetId).offset().top + options.adjustment;
62				event.preventDefault();
63				$('html,body').animate({scrollTop: targetY},options.scrollSpeed,options.easing);
64			
65			}else {
66	
67				var hrefSplit = elementHref.split(/#/);
68				var hrefFirst = hrefSplit[0];
69				var hrefLast = '#' + hrefSplit[1];
70
71				var pathname = location.pathname;
72				var pathnameSplit = pathname.split(/\//);				
73				var pathnameLast = pathnameSplit[pathnameSplit.length - 1];
74				
75				var hostname = location.hostname;
76			
77				function aHrefCheck(){ 
78				 
79					var check1 = hrefFirst.match(/https?:\/\/.[^\/]+\//);
80					if(check1 === null){
81						return true;
82					}else{
83						var check2 = check1[0].indexOf(hostname);
84						if (check2 != -1){
85							return true;
86						}else{
87							return false;
88						}
89					}
90				}			
91		
92				function aHrefChange(){
93					if (hrefFirst.indexOf(hostname) !== -1 || hrefFirst.indexOf(pathnameLast) === -1){
94						hrefLast = hrefLast.replace('#','?id=');			
95						elementHref = hrefFirst + hrefLast;
96						element.attr('href',elementHref);			
97					}else{
98						return;
99					}
100				}
101				
102				if(aHrefCheck() === true){
103					aHrefChange();
104				}else{
105
106					return;
107				}		
108			}
109		});
110				
111		var url = $(location).attr('href');
112		var stringMatch = url.indexOf('?id=');
113		
114		if(stringMatch === -1){
115			return;
116		}else {
117			var urlSplit = url.split(/\?id=/);
118			var anchorLink = '#' + urlSplit[urlSplit.length -1];
119			var anchorLinkTop = $(anchorLink).offset().top + options.adjustment;
120			
121			$('html,body').delay(options.delayTime).animate({scrollTop: anchorLinkTop},options.scrollSpeed,options.easing);
122			
123		}
124
125	return this;
126	
127	});
128
129
130/*
131//--------------------ƒŠƒ“ƒNƒŠƒXƒgÝ’è
132var linkList = $('#yoko-menu li');
133//ƒŠƒXƒg‚ðƒNƒŠƒbƒN‚µ‚½Žž‚̏ˆ—
134linkList.on('click', function () {
135	//ƒŠƒ“ƒN‚ÌclassÝ’è‚ðƒŠƒZƒbƒg
136	linkList.removeClass('current');
137	//ƒNƒŠƒbƒN‚µ‚½ƒŠƒXƒg‚Écurrent‚Ìclass‚ð’ljÁ
138	$(this).addClass('current');
139});
140*/
141
142
143})(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.