1/** 2* smoothScrollEx Plugin ver1.1 3* 4* 2015 Jun Sato http://creator-index.com/ 5* 6* MIT-style license. 7* 8*/ 9 10;(function($s) { 11 $s(window).on('load',function(){ 12 13 var options = $s.extend({ 14 15 scrollSpeed: 1000, 16 easing: 'swing', 17 adjustment: - 90, 18 delayTime: 0 19 20 },options); 21 22if($s('body').is('.mobile')){options.adjustment='-90'*1;} 23 24 $s('a[href\*="#"]').click(function(event){ 25 var element = $s(this); 26 var elementHref = element.attr('href'); 27 28 29 if(elementHref.search(/^#.+/) === 0){ 30 31 var targetId = elementHref; 32 var targetY = $s(targetId).offset().top + options.adjustment; 33 event.preventDefault(); 34 $s('html,body').animate({scrollTop: targetY},options.scrollSpeed,options.easing); 35 36 }else { 37 38 var hrefSplit = elementHref.split(/#/); 39 var hrefFirst = hrefSplit[0]; 40 var hrefLast = '#' + hrefSplit[1]; 41 42 var pathname = location.pathname; 43 var pathnameSplit = pathname.split(/\//); 44 var pathnameLast = pathnameSplit[pathnameSplit.length - 1]; 45 46 var hostname = location.hostname; 47 48 function aHrefCheck(){ 49 50 var check1 = hrefFirst.match(/https?:\/\/.[^\/]+\//); 51 if(check1 === null){ 52 return true; 53 }else{ 54 var check2 = check1[0].indexOf(hostname); 55 if (check2 != -1){ 56 return true; 57 }else{ 58 return false; 59 } 60 } 61 } 62 63 function aHrefChange(){ 64 if (hrefFirst.indexOf(hostname) !== -1 || hrefFirst.indexOf(pathnameLast) === -1){ 65 hrefLast = hrefLast.replace('#','?id='); 66 elementHref = hrefFirst + hrefLast; 67 element.attr('href',elementHref); 68 }else{ 69 return; 70 } 71 } 72 73 if(aHrefCheck() === true){ 74 aHrefChange(); 75 }else{ 76 77 return; 78 } 79 } 80 }); 81 82 var url = $s(location).attr('href'); 83 var stringMatch = url.indexOf('?id='); 84 85 if(stringMatch === -1){ 86 return; 87 }else { 88var query = window.location.search.substring(1); 89var anchorLink=''; 90var vars = query.split("&"); 91for (var i=0;i<vars.length;i++) { 92var pair = vars[i].split("="); 93if (pair[0] =='id'){ 94anchorLink = '#'+pair[1]; 95}} 96// var urlSplit = url.split(/\?id=/); 97// var anchorLink = '#' + urlSplit[urlSplit.length -1]; 98 var anchorLinkTop = $s(anchorLink).offset().top + options.adjustment; 99 if(!anchorLinkTop){anchorLinkTop=0;} 100 101 $s('html,body').delay(options.delayTime).animate({scrollTop: anchorLinkTop},options.scrollSpeed,options.easing); 102 103 } 104 105 return this; 106 107 }); 108 109})(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.