...

View Full Version : ScrollTop working in IE/FF but not in Safari



ctate76
12-03-2009, 07:59 PM
Hi all,

The following script is scrolling my page smoothly, as it is supposed to, in IE and FF however it is not working at all in Safari, any version. The page is:

www.christiantate.net

When working correctly, you click the nav buttons in the left sidebar, the page scrolls to the appropriate section.


The script:


$(function(){

$('a[href*=#]').click(function() {

if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
&& location.hostname == this.hostname) {

var $target = $(this.hash);

$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');

if ($target.length) {

var targetOffset = $target.offset().top-100;

$('html,body').animate({scrollTop: targetOffset}, 1000);

return false;

}

}

});

});

Any help would be greatly appreciated. Thanks

DTD13
12-03-2009, 08:40 PM
check your "doctype"

ctate76
12-17-2009, 07:43 PM
hey, thanks for responding, what should I be looking for in my doctype?

right now it is transitional



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum