|
-
Aug 2nd, 2006, 12:17 PM
#1
Thread Starter
Lively Member
[RESOLVED] Mozilla problem (?)
I am currently making a small website, and have written a JavaScript which choose a css-file based on the user's browser and resolution.
Opera and IE goes without a glitch, but Mozilla Firefox is a pain in the a**! I am using absolute positioning instead of tables, and have made a small section on the top, which the user can make certain settings like selecting different themes and choosing which page to display as default.
The problem is that with Firefox, my hyperlinks move 10px down (outside the top-section) if the user open the website without the status bar. This however is not the case in Opera and IE.
I found out I can eliminate this problem using relative positioning, but this does not work for me, cause I want the hyperlinks in a fixed position.
Why is this happening, any suggestions on how to detect if the status bar is on or off?
Last edited by Mutuz; Aug 2nd, 2006 at 02:51 PM.
-
Aug 2nd, 2006, 01:31 PM
#2
Re: Mozilla problem (?)
Do you have an online version of the page that I can look at?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Aug 2nd, 2006, 02:32 PM
#3
Thread Starter
Lively Member
Re: Mozilla problem (?)
Thanks CornedBee, but I found out that for Firefox' part, the best way to solve this problem is to use fixed positioning.
If you try viewing the site with 1152x864 or 1280x960, it will work the way I want it - except the banner-menu (cause it has absolute positioning!)
But if you change your resolution to 1600x1200 or 1280x1024 you will notice the problem I mentioned. We may argue if this makes Firefox better than other browsers, but I say no!
Last edited by Mutuz; Aug 3rd, 2006 at 07:16 AM.
-
Aug 2nd, 2006, 03:26 PM
#4
Re: [RESOLVED] Mozilla problem (?)
I can't scale beyond 1024x768 on my current system. But neither do I get any settings bar - it just writes "undefined" at the top of the page. Firefox 1.0.7, Fedora Core 3. Apparently, css is undefined in that browser.
That's because I have a recognized browser, but no recognized solution. Whee! Seems your method needs a little more work.
You might want to read this:
http://themaninblue.com/writing/perspective/2004/09/21/
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Aug 2nd, 2006, 03:46 PM
#5
Thread Starter
Lively Member
Re: [RESOLVED] Mozilla problem (?)
Sorry about that, in its current state it supports only those resolutions I mentioned in the last post! Thanks for the tip, I will read the article as it may suggest a better way of doing it!
-
Aug 2nd, 2006, 03:50 PM
#6
Re: [RESOLVED] Mozilla problem (?)
OK, I had a closer look at the page and tricked my browser into using the 1280x1024 stylesheet. I still can't really see your problem because I can't see any configuration bar, but I'm pretty sure I don't want to look for it. Your current problem is not Firefox, it's your completely screwed up HTML. It's a wonder any browser does anything resembling something proper with it. You have to HTML opening tags, two complete HEAD elements (well, not complete, because TITLE is a required child of HEAD), two BODY opening tags, you write with JS normal content into the HEAD, you have unquoted non-trivial attribute values, you have the same ID attribute value up to 5 times. (IDs must be unique across the document. To have a style hook on several elements, use the class attribute.) Do not expect anything resembling consistent behaviour on invalid HTML, especially that invalid HTML.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Aug 2nd, 2006, 03:52 PM
#7
Re: [RESOLVED] Mozilla problem (?)
Additionally, what you're trying to achieve is doomed to fail: even if you'd get Firefox to work that way (which is entirely possible), you'd still face the problem you're targetting specific browsers and resolutions (I use exotic 1360 x 1024). Generally, what you want to do is to make CSS that works equally well on all browsers; although due to the many bugs of IE you probably eventually run into a situatation where Firefox and Opera work equally, but IE doesn't get it at all. Luckily conditional comments technique helps here a fair bit.
You're controlling the style entirely on JavaScript. This is a big no. Make it work without JavaScript, only add JavaScript to give more features. Don't rely everything on it. Every browser supports CSS and CSS is always in use, JavaScript is not.
-
Aug 2nd, 2006, 03:59 PM
#8
Thread Starter
Lively Member
-
Aug 2nd, 2006, 05:39 PM
#9
Re: [RESOLVED] Mozilla problem (?)
No, I'm not overreacting. Your HTML is a mess, and using XHTML wouldn't really change it: although by concept, XHTML is much stricter, you'd still send it as text/html (otherwise IE refuses to interpret it, and document.write() wouldn't work) and thus still get the lazy HTML evaluation. In fact, you'd just be sending broken HTML.
No, what you should do is submit your page to the W3C HTML validator:
http://validator.w3.org/
This is what you get when you submit your page:
http://validator.w3.org/check?uri=ht...rg%2F%7Emorten
You need a DOCTYPE declaration. You need a character set declaration in a meta. You need to correct the errors that will then show up.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Aug 3rd, 2006, 12:52 AM
#10
Thread Starter
Lively Member
Re: [RESOLVED] Mozilla problem (?)
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|