On 18/02/2007, at 6:13 AM, Karl Swedberg wrote:
> ok, now that the smooth scrolling has Klaus's blessing :) ... I
> thought I'd share some code I wrote to make it happen for all same-
> page links. It takes into account the difference in the way the
> various browsers treat href.
Thanks for sharing that code Karl.
Okay, that has me worried that my solution (which I thought worked
perfectly) may be flawed in ways I was not aware of. Here is the code
I am using to attach the scrollTo plugin to elements that have a
class of "scrolls":
(function($){
$.fn.scrollToHash = function(){
return this.each(function(){
$(this).click(function(){
$(this.hash).ScrollTo(1500,'easeout')[0].blur();
return false;
});
});
};
)(jQuery);
$(function(){
$("a.scrolls").scrollToHash();
});
Karl, I'm sure there must be issues I am not aware of here. Can you
or anyone point them out for me? This code seems to work in all the
browsers I have tested including IE6 and IE7, it's the exact code I
am using on Preshil, but maybe I am overlooking something.
Thanks.
Joel.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/