Jeff and .NET

The .NET musings of Jeff Putz

Sponsors

News

My Sites

Archives

DHTML is a pain in the ass

I have to say that every time I try to do a little DHTML, I start to curse the world. I found a neat little Javascript function that finds the position of an element, which makes it handy to position another element on the page relative to that one.

It works like a champ... in IE. It doesn't work in Firefox. The weird thing is that it doesn't throw any kind of error in the Firefox Javascript console either.

Stuff like this makes it amazing to me that anyone ever gets ajax stuff to work in most browsers.
Posted: Aug 31 2005, 11:36 PM by Jeff | with 4 comment(s)
Filed under:

Comments

Dave said:

Here is what I would do.
Do two dev paths concurrently.
1. IE - gets dhtml bells whistles. When doing this use good Dom Practices, Try not to do things that are IE specific like document.all etc..

2. Everything else. Code for No Javascript, No dhtML, No Cookies etc.

Finish your site.

Now if money and time warrants you can start adding the uplevel items to other browsers in a dhtml manner do it then (It seldom does though)

I'm not saying that firefox shouldn't get the uplevel items, just usually isn't cost effective unless its a personal site.

# September 1, 2005 1:19 AM

Jeff said:

But that's not an acceptable solution when 30% of your user base is using Firefox. Especially when it's something that seems so relatively simple.
# September 1, 2005 2:03 AM

Drew Marsh said:

Well the script looks as crossbrowser as it can be (considering the offsetXXX properties aren't part of the DOM standard) and I just tried it out and it works no problem in Mozilla (v1.0.6) for me.
# September 1, 2005 5:41 PM

Jeff said:

Yeah, worked for me too once I tacked on "px" to the values, just as the article says you should. Next time I'll RTFM! ;)
# September 1, 2005 8:54 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)