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
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