Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

anchors not working on safari / msie mac

Status
Not open for further replies.

MasterKaos

Programmer
Jan 17, 2004
107
GB
Not owning a mac makes it difficult for me to debug this, but apparently the anchor tags on this page are not working.

So clicking on the Sydney, Brisbane etc links should scroll down to the correct part of the page. Works fine in FireFox (windows and mac) and msie for windows, but apparently they don't work in safari or msie mac. In safari, nothing happens at all, and in msie mac it scrolls down the actual window, rather than scrolling the div where the anchor is.

Any tips on how i could get this to work??

----------------------------------------------------------------------------
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
 
Safari issues aside, why are you mixing CSS with deprecated elements like font, and outdated attributes like topmargin, marginwidth, etc?

Why not just use CSS? Why the mix of old and new?

Also, your CSS classes seem to be repeated an awful lot when they do not need to be. You seem to be setting the font details on virtually every element (through the confoilbody and confoilheaders classes). This does not need to be done - there are far better ways of setting the font for all elements you need to.

Hope this helps,
Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
God knows i didn't design or code that site, I agree it's a terrible mess and it makes me sick looking at the code. I'm in charge of the database back-end, and trying to fix the god-awful JS menu someone did.

So, to get back on topic, why are the anchors not working? Are you saying that if we took out the font tags and the repeating CSS, then the mac anchors would work?

----------------------------------------------------------------------------
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
 
Other than being rather slow, I can't see what you mean regarding the anchor problem.
The only way I could stop the site working in Safari was to turn off Javascript.

Could you be more specific as to where the problem occurs and describe the behaviour you expect vs what is happening?

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
Could you be more specific as to where the problem occurs and describe the behaviour you expect vs what is happening?

Expected Behaviour: Click on "Brisbane", and the div where the text content is scrolls to the contact address of the Brisbane office.

What is Happening in Safari: Click on "Brisbane", nothing happens.

What is Happening in MSIE: Click on "Brisbane" entire page scrolls down to a blank area of the screen far away from any of the (static) content.

What version of safari and MSIE are you using Foamcow? The problem has been sited in the versions of MSIE and Safari that come with OSX, 5.2 for MSIE i think not sure what ver safari...

----------------------------------------------------------------------------
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
 
Safari 1.3(v312)

And it does exhibit the behavior or rather non-behaviour you mention.

Hmm. I've not got time to look at the javascript and it's not my strong point either.

If I were you I'd just take the javascript out of those Contact links and see if it works then. If so then you've identified the culprit. I can't see the point of that big JS function on those links anyway!

Thinking about it further, the problem may be that the anchors are within a scrolling div.
Just as test, stop that div being restricted in height and see if it works then. Perhaps Safari/MacIE cannot shift the position of the div. You might have to do something to identify that the anchor is within the scrolling div.
The more I think about it, the more likely that I feel this is the reason it doesn't work.

Sorry, I can't offer any kind of solution right now, but if I get chance I will do some tests.

The site would be nicer if it wasn't height constrained the way it is anyway. :)


Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
Foamcow said:
The site would be nicer if it wasn't height constrained the way it is anyway. :)

Careful there, Foamcow... you might also get flamed with a "I didn't ask for a style critique" just for offering genuinely helpful comments.

Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Hehe, yeah BillyRay is right, i'm touchy on that point ;-)

Sorry if i went off BillRay, but this project has been a bit of a nightmare, and a lesson for me to stay far away from any site that's been designed / coded by a graphic designer. It is now a requirement that anyone wishing me to work together with them on a project prove that i'll be working with well-documented standards compliant code. There's only one thing worse than coming across another badly designed / coded site on the internet, that's knowing you somehow contributed to it! I'll never forget when the guy asked me if i could somehow replace a drop-down form element with graphic images!

Anyway, back on the topic, I think FoamCow might be onto something with the content being inside a div. It's a pity that most non-mac browsers don't have a problem with it. It's certainly not the javascript or anything else, because even typing in the explicit address with #brisbane on the end doesn't work.

I might just replace the anchors with overlapping fixed positioned divs that are set to visibility:hidden then revealed. I know it could be designed much better from scratch, but this might be the best solution right now. I can re-use some code that's being used in the product database display section.

----------------------------------------------------------------------------
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
 
I'd just link them to different pages mate, don't use internal anchors at all.

Make a static page for each address and have the link load that page in when it's clicked. Low tech, but it will work every time.

For the record... I'm a graphic designer ;)

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
Hehe i meant graphic designers that don't take into account anything about HTML, CSS, standards, accessability, fast loading pages etc ;-)

----------------------------------------------------------------------------
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
 

I'll have a try later on this evening when I get home... but I was thinking about your comment regarding the problem being Mac specific -- and wondered if there might be a way to replicate this on a Windows machine (to help you fix/test etc).

Safari is based on the Konquorer (sp?) browser code base... I wonder if there is a Windows build (not of Safari, but of a similar code-base based browser) that might also exhibit this behaviour.

It's odd that IE5.2 breaks in the same way (and it's certainly NOT based on the same code-base *lol*)... I personally don't use it now (M$oft discontinued any further development of the Mac version well over a year ago now) but it used to do a fairly good job at rendering and performing (where the Windows versions of IE would break).

I'll add IE 5.2 to the tests when I make it home.

Quick question... have you had any (anecdotal) success with Firefox on the Mac?

Roll on 5.30p!
Jeff

 
have you had any (anecdotal) success with Firefox on the Mac?

Yes, i have been told it works on FireFox for mac. In my experience, IE for mac has been the biggest pain to get HTML to work on. I mean in the past, things that worked on everything from netscape 6 to Opera on wintel, firefox, mozilla etc on linux, and even sfari on mac, would not work on msie for mac. Honestly, if i could pick a single most troublesome browser (well since netscape 4) it would be IE for mac.

I think i'll get rid of the anchors and use invisble divs instead. I jsut thought maybe i was missing something really obvious, but if it's this cryptic then i will assume it's the god-awful way the thing has been coded that makes it break on mac.

----------------------------------------------------------------------------
The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top