Archive for the ‘code’ Category
Thursday, December 17th, 2009
I recently came up against a situation where I wanted to add rows to a table via javascript.
Not a problem with jQuery, EXCEPT that my table rows were being added with 'style="display:block"'.
What's wrong with that, you ask? Well, in Firefox the row was being appended to the table but it looked all scrunched into the first cell like so:

OK, fine. Let's give it a display property of "table-row." That should work, right? Yes, it works here but not in IE. IE hates this, in fact. IE wants to get a display of "block."
The solution turns out to be to set the display value to an empty string. Then, each browser will give the row its default value and everyone is happy.
source: http://cormacscode.wordpress.com/2008/11/28/show-hide-table-row-in-firefox-versus-ie/
Tags: javascript
Posted in code | No Comments »
Tuesday, March 17th, 2009
Who knew?
Though it's not best practice to resize images in the browser this could really be useful in the right situation:
img { -ms-interpolation-mode: bicubic; }
This little snippet will vastly improve the image resizing abilities of ie — bringing it closer to the resized image quality experienced with Firefox or Safari.
example
[seen at devthought via css-tricks]
Tags: css, ie
Posted in code | 1 Comment »
Wednesday, February 20th, 2008
I had a javascript hiccup, and I think the solution may be helpful to others.
The basic setup is this:
Limited space means no room for labels in a login form. So instead we used a preset value in the input elements, like so:
<input value="Username" name="username" type="text" />
<input value="Password" name="password" type="text" />
Which looks like this:
The easy way to blank out the descriptive text is to use the onfocus event like so:
onfocus="this.value=''"
(more…)
Tags: ie, javascript, safari
Posted in code | No Comments »