[ Index ]

PHP Cross Reference of phpwcms V1.5.0 _r431 (28.01.12)

title

Body

[close]

/template/lib/mootools/more-1.4/Fx/ -> Fx.SmoothScroll.js (source)

   1  var SmoothScroll=Fx.SmoothScroll=new Class({Extends:Fx.Scroll,options:{axes:["x","y"]},initialize:function(options,context){context=context||document;this.doc=context.getDocument();this.parent(this.doc,options);var win=context.getWindow(),location=win.location.href.match(/^[^#]*/)[0]+"#",links=$$(this.options.links||this.doc.links);links.each(function(link){if(link.href.indexOf(location)!=0){return}var anchor=link.href.substr(location.length);if(anchor){this.useLink(link,anchor)}},this);this.addEvent("complete",function(){win.location.hash=this.anchor;this.element.scrollTo(this.to[0],this.to[1])},true)},useLink:function(link,anchor){link.addEvent("click",function(event){var el=document.id(anchor)||this.doc.getElement("a[name="+anchor+"]");if(!el){return}event.preventDefault();this.toElement(el,this.options.axes).chain(function(){this.fireEvent("scrolledTo",[link,el])}.bind(this));this.anchor=anchor}.bind(this));return this}});


Generated: Sun Jan 29 16:31:14 2012 Cross-referenced by PHPXref 0.7.1