Scripting: Floating Layer Script and Apple Mac

started by Flaxen on Feb 24, 2004 — RSS Feed

Flaxen Flaxen
Posts: 28

I am using a floating layer script to animate a menu on a site. This works just fine for all the Windows browsers I usually check with, but I have been informed that it behaves differently on Apple
Mac's.

Having not seen the phenomenon, I can only say that I was told that it 'bounces' annoyingly instead of gliding into place.

If anyone can tell me of any previous experience of this or similar I would be interested.

Baxter Baxter
Posts: 157

Can you offer a link or something so we can take a look?

Flaxen Flaxen
Posts: 28

Certainly can, sorry, I'm a bit of a newbie to forums...

www.highgroundcoffee.co.uk

Baxter Baxter
Posts: 157

Honestly, it bounces annoyingly in XP/Firebird, too. I would suggest ditching the javascript you're using, put the menu in a Div with the position set to fixed, then grab one of the well-documented scripts to trick IE into accepting the position:fixed rule.

Flaxen Flaxen
Posts: 28

Things just get worse - I'm using XP and it behaves for me. Looks like I will have to rethink.

Joe Gillespie Joe Gillespie
Posts: 528

Baxter said:
grab one of the well-documented scripts to trick IE into accepting the position:fixed rule.


I wouldn't advise that. Hacks like this might work today but Microsoft have a habit of bringing out 'security updates' that change such behaviours. It's okay to use 'workarounds' to get round some of IEs many problems - such a s NOT using left and right padding, but using hacks to provide critical functionality like navigation is really inviting trouble.

Flaxen Flaxen
Posts: 28

I'd have to agree, I don't like the idea of using such methods of overcoming a problem - but it still leaves me completely clueless as to how to solve (or even really understand) the problem.

I've been searching Google for days trying to find something, anything to point me in the right direction....and all it's doing is stressing me out!

Joe Gillespie Joe Gillespie
Posts: 528

When something doesn't work as you expected, the first thing to do is check the validation of your page. There are three steps involved but I'm assuming no particular platform.

First, validate the HTML. You can just enter a URL or you can upload the file if it's not online at W3C HTML Validator. This will help identify any problems on the page. I can see that you have some because your pages can't validate.

Next, validate the CSS. Same way at W3C CSS Validator.

The, validate the JavaScript. You can use Mozilla, Netscape 7 or FireFox to do this.

Hopefully, these tests will help identify where the problem is so that you can fix it.

There are some problems that are down to bugs (or just lack of feature support) in individual browsers. You soon get to know what they are but the most serious ones are in Explorer at the minute - Windows and Mac.

Baxter Baxter
Posts: 157

In this case, I disagree... He's already using javascript to control the menu positioning, I'm simply suggesting using a simpler, well-documented script to do basically the same thing. If it does break, the menu just won't stay fixed. No big deal. And compliant browsers are going to ignore it anyway. Much less room for error than the current setup.

Flaxen Flaxen
Posts: 28

Baxter, I'm a she, not a he  

Am currently trying to validate all my pages on the site, and otherwise running through the suggestions made by the Admin......hampered by the fact that my PC had a strange fit the other night (incidentally I found 2 instances of a virus I'm still trying to track down the source of...damn those pesky kids using my PC!) and I'm currently trying to find time to re-image my Windows installation and re-install all my bits and pieces.

I'm sure that within the next few days I will have a few more questions as to why my pages won't validate!  


Baxter Baxter
Posts: 157

My apologies on the gender confusion. I should know better than to presuppose.

Now, as for your problem, I still maintain that the small and well-documented IE fixed-positioning fix is a much more acceptable solution than the whole passel o' Javascript you have going now. It's small, bandwidth friendly, well-known, predictable and degrades gracefully. When (if) Microsoft ever supports position:fixed, you can remove all traces of your workaround by removing ONE line of code. At any rate, even if the code doesn't work, it won't jam up your navigation, it just won't stay fixed in place.

Or how bout forgetting the script altogether, and people on decent browsers get the fixed menu, and stupid IE doesn't.

Right now you've got how many javascripts working that site? Honestly, I'm not sure why you need ANY, unless there's some function in there I'm not seeing.
Certainly one could do it.

And before you even bother validating, have a go-though on your source code. Once you think it's clean, then have the validator go at it.

Flaxen Flaxen
Posts: 28

I agree, personally I wouldn't have that moving menu, but I'm working with clients who have NO...and I mean NO understanding of the web whatsoever, and they really love that feature, so I'm trying to keep it in there if I can!

I'd be quite happy having written the shopping cart software and making all that work for them, not to be messing about with completely useless, unnecessary rubbish (I'm not a bells and whistles person, I like functionality first and appeal second as a whole) but you know what they say: 'The customer is always right....'

And I actually only have 2 scripts running, one for the form validation at the checkout, and one, which admittedly, is split into 2 sections, running that supposedly floating layer menu..The reason it is split into 2 is not entirely clear to me, but it was the only way I could get it work at all ( my Javascript skills are still in their infancy, unfortunately)

Baxter Baxter
Posts: 157

Well, a simple position:fixed will set you up in everything BUT IE. As for IE, take a look at this:http://devnull.tagsoup.com/fixed/

I'm not saying it's the only way to do it, or even the best way, but it's a start.

Hitthosekeys Hitthosekeys
Posts: 10

Well, a simple position:fixed will set you up in everything BUT IE. As for IE, take a look at this:http://devnull.tagsoup.com/fixed/

 
Related to the link Baxter posted, here's a fixed layer example:

http://66.201.73.13/mxvision/fixednav/fixedbar.htm

Flaxen Flaxen
Posts: 28

That's an interesting link, hitthosekeys, a nice solution that I may well use at another time....but I think my original problem is somewhat different....I was trying to use a floating layer script, because thats what my client liked best. (follow the link in the 3rd post to see what I mean.) The problem I was having that whilst it works, as far as I can test i.e. IE, Netscape, Opera, Konqueror etc I have been told it behaves somewhat differently on an Apple MAC.

Still working on validating everything, to see if I've just hit a weird quirk, but if you have any insight into this, I'd love to know.

Baxter Baxter
Posts: 157

Tell me again how what you're doing is substantially different than just setting the position to fixed...

Flaxen Flaxen
Posts: 28

Ok. the end result I'm looking for is that the left menu bar appears at the top left of the page when the page loads, but when you scroll the page down to read 'below the fold' the menu, which is on a 'floating layer' using a Javascript should, with a very slight delay follow the page down and again come to rest at top left.

Have a look at this example I found that might help you understand what I mean, if my script isn't working right for you.

http://www.echoecho.com/toolfloatinglayer.htm

Baxter Baxter
Posts: 157

I know I'm not much help and i'm really just repeating myself, but I would ditch the idea. That's a hundred lines or more of javascript to create an effect which, in my mind, just isn't worth it.

I would just set it to fixed position and move on. Sorry I'm not more help than that.

Flaxen Flaxen
Posts: 28

Thanks anyway, Baxter. I do appreciate your input, and you might well be right, I should abandon the whole stupid thing, but to try and give my client my best attempt I shall try all avenues first.

Then I'll give up!

You must login to reply