mrdaliri
mrdaliri

Reputation: 7328

jquery/html position problem

I use this script: http://jixedbar.rawswift.com/

It works perfect, but I've a problem with it, if I use it in a html page, without the <!DOCTYPE>, it works in Mozilla, but in IE, it will broke down. (you can test it)

Where is the problem? (I think the problem can be in positions, fixed and absolute.) And how can I solve it?

Thank you very much..

Upvotes: 1

Views: 140

Answers (2)

TheEdonian
TheEdonian

Reputation: 88

You should always use a doctype. As stated before, the browser falls back on older render engines if none is declared.Check http://www.w3schools.com/tags/tag_doctype.asp for more info about doctypes and how to use them.

Upvotes: 0

Raynos
Raynos

Reputation: 169373

THe issue is that not declaring a doctype makes IE drop into quirksmode.

Quirksmode uses the IE5 javascript engine which breaks most recent javascript code. Basically what your asking is why does this script not work in IE5!!

Firefox also drops into quirksmode but uses its mozilla javascript engine which is complaint with standards. IE will drop back to a broken javascript engine but firefox doesnt.

The easy answer is use <!DOCTYPE> to force it into HTML5 mode. or use a html4.01 doctype if you want.

If you want it to work in IE5 then your on your own.

Upvotes: 2

Related Questions