I've implemented a technique similar to this. here is the code i used:

$.fn.scrollInterface = function(s) {
    var $handles = $('a', this).add('a.top'),
        s = s || 300;
    $handles.click(function(){
        this._href = (!this._href) ? "#" + this.href.split('#')[1] : this._href;
        $(this._href).ScrollTo(s);
        return false;
    });
}

Then i just add scrollInterface to the document.ready like:

$('#faq-questions').scrollInterface(300);

hth,
wil

On 10/6/06, Klaus Hartl <[EMAIL PROTECTED] > wrote:


Ⓙⓐⓚⓔ schrieb:
> I looked at that page... wouldn't it be cooler to just say <a
> href="" and have it scroll to <a name="place"> ?
>
> and let JQ do it all behind the scenes?
>
> Is there a more experienced JQ person out there to tackle this?

That is to me also the desired way to do it. It would be totally
unobtrusive, would work without _javascript_ as well and the information
where to scroll could be gathered automatically from the link...:

$(...).click(function() {
     var to = '#' + this.href.split('#')[1];
     $(to).ScrollTo(1000, 'easeout')"
});


-- Klaus

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to