Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ScrollTop working in IE/FF but not in Safari

    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:

    Code:
    $(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

  • #2
    New Coder
    Join Date
    Nov 2009
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts
    check your "doctype"

  • #3
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hey, thanks for responding, what should I be looking for in my doctype?

    right now it is transitional


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •