Anchors not working in CSS layout in Safari

Discussion in 'Web Design and Development (archive)' started by obelix, Nov 8, 2005.

  1. macrumors member

    Joined:
    Oct 20, 2004
    #1
    Well they seem to work in both IE and FIREFOX but I just can't seem to get anchors to work in Safari. Apparently this is an issue to do with CSS and the overflow property. I found some information on it here:

    http://blog.deconcept.com/code/overflowsafari/overflowsafari.html

    However the fix doesn't seem to work for me. The page I am working on is here:

    http://www.tumbara.com/demo/index2.php?action=about#c1

    I've tried all sorts of things to try to get this to work but no such luck. I'm just at my wits end. Any ideas what could be happening here?
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    What exactly is not working?

    Also the first link is broken.
     
  3. Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #3
    There was just another thread about anchors not working in Safari: http://forums.macrumors.com/showthread.php?t=159809

    It's just one of the many small annoyances with Safari, like they display the "Question-mark square" whenever an image is missing, instead of displaying the contents of the alt tag, like they should...
     
  4. thread starter macrumors member

    Joined:
    Oct 20, 2004
    #4
    Sorry it looks like I posted the wrong link...

    http://blog.deconcept.com/code/overflowsafari/overflowsafari.html

    What exactly is not working? Well the anchors aren't working. If you click the "Tumbara Project" or "Interview with Keith Baker" links you will find that they don't jump down the page like they should. If you open it in Camino or Firefox it works fine... same with IE... it just doesn't work in Firefox.

    I'm just not sure how to implement what they are talking about in the blog into my code.
     
  5. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #5
    Right. It's nice and simple. If you look at the source code of the JavaScript fix in the linked example it includes a JavaScript file that defines scrollDivToAnchor. I don't see that on your page.

    When I click on the first link (The Tumbara Project) I see the following in the JavaScript console (turn on the Safari Debug menu):

    Object (result of expression scrollDivToAnchor) does not allow calls.
    http://www.tumbara.com/demo/index2.php?action=about#c1
     
  6. thread starter macrumors member

    Joined:
    Oct 20, 2004
  7. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #7
    Sorry for the delay in replying, been having a nice sleep! Again it's very simple! Did you even read the JS Code? It defines a variable called targBox. In the file you are including it's set to "box". It has to be set to the id of the div that contains the anchors you want to scroll to.
     
  8. thread starter macrumors member

    Joined:
    Oct 20, 2004
    #8
    Sorry for wasting your time Robbie, I knew that needed to go in there but I guess I neglected to add it in with the last little update. I had taken everything out of the code you see because I wanted to try some other things and then when I made this post I forgot to add a few things back in. Sorry for all the trouble... you've been most helpful :) .... oh and it works now! Yay!
     
  9. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #9
    It's not a problem! I'm glad to here that it's all working for you now :)
     

Share This Page