Top.Mail.Ru
? ?
entries friends calendar profile The Gossamer Project
cschick, posts by tag: coding - LiveJournal
For the End of the World!
CSS to duplicate IE rounded corners on fieldsets in Firefox and Safari:

-moz-border-radius-bottomleft: 7px;
-moz-border-radius-bottomright: 7px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 7px;
-webkit-border-radius: 7px;
border-radius: 3px;

Note: may also be able to be used to put rounded corners on divs in FF and Safari. But fieldsets are the only way to achieve rounded corners in IE using easy html/css.

Tags:

2 comments or Leave a comment
So, as I've mentioned, I've been living and breathing Javascript recently. Which, for a database systems developer with a very solid knowledge of Java is just relatively depressing.

So, here's my Javascript advice for those other googling developers trapped in the hell that is Javascript: NEVER, EVER use getElementsByClassName if any user of yours will be using Internet Explorer.

First, if you try treeElement.getElementsByClassName on any element of the tree but document, you get this lovely error message from Internet Explorer: Not Implemented. Okay, not a don't-know-what-the-fuck-you're-doing error, but a know-what-you're-doing-and-our-engineers-decided-not-to-implement-it error.

Second, a good way to LAG Internet Explorer is to call document.getElementsByClassName on a heavily populated DOM tree. Oh my god, that must be the slowest provided operation possible in the current browser world. In our system, it can take a full second or MORE for the browser to respond again once it hits that function.

Since I have spent days coding around every instance of document.getElementsByClassName in our system, here are my recommended alternatives.

If you know the parent element of the element(s) you're looking for, get the parent element by ID, and loop through the childNodes looking for the desired className.

Example:
	var parentDiv = document.getElementById(id)
	for (var i = 0; i<parentDiv.childNodes.length; i++)
	{
		if (parentDiv.childNodes[i].className == "ClassName")
			parentDiv.childNodes[i].className = "OtherClassName";
	}

Yes, you are basically implementing treeElement.getElementsByClassName here. A bit more thought, and you'll have your own implementation!

This slows down Firefox just slightly over its internal implementation of treeElement.getElementsByClassName, but it is far, far more responsive in IE than document.getElementsByClassName.

treeElement.getElementsByTagName actually does work in Internet Explorer. So, that's another possible solution: if all the elements you want have the same tag ("div" for example), grab them using the parent element and do whatever you need.

Tags: ,

Leave a comment
WHY is there no journal layout with a floating menu? Can I be the only one that thinks that having a whole section of the screen space taken over by a menu that only fills like 1/5 of that space is just totally wasteful? Can I be the only one that wants my entry text to fill in below the menu once the menu is done?

Damn it. I once designed a layout with a floating menu using the old style and CSS, but it was lost over on JF during one of the crashes. I think I need to do that again.

Tags: ,

6 comments or Leave a comment