PageSourceSearch

https://digimarconbarcelona.es/wp-content/cache/min/1/wp-content/t…/js/jquery.smoothScroll.js?ver=1783585872

js digimarconbarcelona.es collected 2026-09-28 08:10:10 UTC 3,607 bytes, 11 lines download raw bytes

1(function($){var version='1.4.10',defaults={exclude:[],excludeWithin:[],offset:0,direction:'top',scrollElement:null,scrollTarget:null,beforeScroll:function(){},afterScroll:function(){},easing:'swing',speed:400,autoCoefficent:2},getScrollable=function(opts){var scrollable=[],scrolled=!1,dir=opts.dir&&opts.dir=='left'?'scrollLeft':'scrollTop';this.each(function(){if(this==document||this==window){return}
2var el=$(this);if(el[dir]()>0){scrollable.push(this)}else{el[dir](1);scrolled=el[dir]()>0;if(scrolled){scrollable.push(this)}
3el[dir](0)}});if(!scrollable.length){this.each(function(index){if(this.nodeName==='BODY'){scrollable=[this]}})}
4if(opts.el==='first'&&scrollable.length>1){scrollable=[scrollable[0]]}
5return scrollable},isTouch='ontouchend' in document;$.fn.extend({scrollable:function(dir){var scrl=getScrollable.call(this,{dir:dir});return this.pushStack(scrl)},firstScrollable:function(dir){var scrl=getScrollable.call(this,{el:'first',dir:dir});return this.pushStack(scrl)},smoothScroll:function(options){options=options||{};var opts=$.extend({},$.fn.smoothScroll.defaults,options),locationPath=$.smoothScroll.filterPath(location.pathname);this.unbind('click.smoothscroll').bind('click.smoothscroll',function(event){var link=this,$link=$(this),exclude=opts.exclude,excludeWithin=opts.excludeWithin,elCounter=0,ewlCounter=0,include=!0,clickOpts={},hostMatch=((location.hostname===link.hostname)||!link.hostname),pathMatch=opts.scrollTarget||($.smoothScroll.filterPath(link.pathname)||locationPath)===locationPath,thisHash=escapeSelector(link.hash);if(!opts.scrollTarget&&(!hostMatch||!pathMatch||!thisHash)){include=!1}else{while(include&&elCounter<exclude.length){if($link.is(escapeSelector(exclude[elCounter++]))){include=!1}}
6while(include&&ewlCounter<excludeWithin.length){if($link.closest(excludeWithin[ewlCounter++]).length){include=!1}}}
7if(include){event.preventDefault();$.extend(clickOpts,opts,{scrollTarget:opts.scrollTarget||thisHash,link:link});$.smoothScroll(clickOpts)}});return this}});$.smoothScroll=function(options,px){var opts,$scroller,scrollTargetOffset,speed,scrollerOffset=0,offPos='offset',scrollDir='scrollTop',aniProps={},aniOpts={},scrollprops=[];if(typeof options==='number'){opts=$.fn.smoothScroll.defaults;scrollTargetOffset=options}else{opts=$.extend({},$.fn.smoothScroll.defaults,options||{});if(opts.scrollElement){offPos='position';if(opts.scrollElement.css('position')=='static'){opts.scrollElement.css('position','relative')}}}
8opts=$.extend({link:null},opts);scrollDir=opts.direction=='left'?'scrollLeft':scrollDir;if(opts.scrollElement){$scroller=opts.scrollElement;scrollerOffset=$scroller[scrollDir]()}else{$scroller=$('html, body').firstScrollable()}
9opts.beforeScroll.call($scroller,opts);scrollTargetOffset=(typeof options==='number')?options:px||($(opts.scrollTarget)[offPos]()&&$(opts.scrollTarget)[offPos]()[opts.direction])||0;aniProps[scrollDir]=scrollTargetOffset+scrollerOffset+opts.offset;speed=opts.speed;if(speed==='auto'){speed=aniProps[scrollDir]||$scroller.scrollTop();speed=speed/opts.autoCoefficent}
10aniOpts={duration:speed,easing:opts.easing,complete:function(){opts.afterScroll.call(opts.link,opts)}};if(opts.step){aniOpts.step=opts.step}
11if($scroller.length){$scroller.stop().animate(aniProps,aniOpts)}else{opts.afterScroll.call(opts.link,opts)}};$.smoothScroll.version=version;$.smoothScroll.filterPath=function(string){return string.replace(/^\//,'').replace(/(index|default).[a-zA-Z]{3,4}$/,'').replace(/\/$/,'')};$.fn.smoothScroll.defaults=defaults;function escapeSelector(str){return str.replace(/(:|\.)/g,'\\$1')}})(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.