Web Standards Solutions

General No Comments »

Today my book arrived; Web Standards Solutions by Dan Cederholm.

I’ve read this book already (University was good for something at least - a well stocked library!), but I wanted to get a copy of it. I managed to get a copy for around £10 from Amazon Marketplace - and believe me, its worth every penny.

I’ve read dozens of books on usability, accessibility and web standards and have to say this is the best, from a technical perspective. Dan gives solutions to common CSS problems and discusses methods of overcoming them - giving the pro’s and con’s of each.

It’s the kind of book I would like to write - I would call mine “position:relative or height:1% usually fixes IE”.

Submit button cursors

Web Design No Comments »

The other day Colin made a valid point about input button cursors. As most of us know, by default they are arrow cursors - but he said they should be pointing fingers, like hyperlinks are. I told him that changing them goes against web conventions (even Google uses arrows I said) and “Krug says” to stick to conventions as we all know. Stu then lifted up the cover of Don’t Make Me Think with a big finger hovering over a submit button. “pwn3d” comes to mind.

So I gave in to the pressure and decided to implement the usability issue that I agree, should be addressed. The fix is simple - or could be. If CSS had advanced to version 2 in all modern browsers (in other words, if IE supported CSS2), you could simply apply the following CSS rule:

input[type="submit"] { cursor:pointer;}

Alas, you have to end up doing this (in HTML):

<input type="submit" class="submitbutton" value="Whatever" />

and this (in CSS):

.submitbutton{ cursor:pointer;}

You could also do a nifty JavaScript to do it for you. Something like this would work:

function cursorMySubmits()
{
	var submitButtons = document.getElementsByTagName("input");
	for (var i=0; i<submitbuttons .length; i++)
	{
		if(submitButtons[i].type == "submit")
		{
			submitButtons[i].style.cursor = "pointer";
		}
	}
}
window.onload = cursorMySubmits;

It should be noted that using JavaScript is considered bad for accessibility reasons - so only use the above method if it’s too late to use CSS.

This is the above “Submit button finger-pointer cursor” script in action.

I should write a technical book on addressing these kind of usability issues - there are many more, just ask Colin - our in-house usability Guru.

Browser Stats (November ‘06)

Web Design No Comments »

With the release of IE7 and Firefox 2.0 recently, I wondered how this would effect browser statistics. This following statistics table is taken from webreference.com; and is therefore probably more bias given their “developer” visitor base - who tend to upgrade software more often. That said, it still makes for interesting reading:

Tue Nov 21 23:50:07 EST 2006
Unique Visitors:    41989
	
Major Versions               Count               Share(%)
---------------------------------------------------------
OP 3                             1                   0.00
OP 5                             7                   0.02
OP 6                             3                   0.01
OP 7                            13                   0.03
OP 8                            73                   0.17
OP 9                           523                   1.25
OP ALL                         620                   1.48
SF 0                             3                   0.01
SF 100                           2                   0.00
SF 125                           6                   0.01
SF 312                         126                   0.30
SF 412                          21                   0.05
SF 416                           7                   0.02
SF 417                          41                   0.10
SF 419                         723                   1.72
SF 420                           7                   0.02
SF 521                           3                   0.01
SF 85                            5                   0.01
SF 94                            1                   0.00
SF ALL                         945                   2.25
NS 2                             1                   0.00
NS 3                             2                   0.00
NS 4                           205                   0.49
NS 5                          1906                   4.54
NS 6                             2                   0.00
NS ALL                        2116                   5.04
FF 0                             1                   0.00
FF 0.1                           1                   0.00
FF 0.10                          5                   0.01
FF 0.10.1                       10                   0.02
FF 0.8                           4                   0.01
FF 0.9                           1                   0.00
FF 0.9.1                         1                   0.00
FF 0.9.2                         1                   0.00
FF 0.9.3                         4                   0.01
FF 0.9.6                         2                   0.00
FF 1.0                          69                   0.16
FF 1.0.1                        13                   0.03
FF 1.0.2                         9                   0.02
FF 1.0.3                         8                   0.02
FF 1.0.4                        72                   0.17
FF 1.0.5                         3                   0.01
FF 1.0.6                        88                   0.21
FF 1.0.7                       294                   0.70
FF 1.0.8                        23                   0.05
FF 1.4                           2                   0.00
FF 1.4.1                         4                   0.01
FF 1.5                          72                   0.17
FF 1.5.0.1                      80                   0.19
FF 1.5.0.2                      26                   0.06
FF 1.5.0.3                      74                   0.18
FF 1.5.0.4                     113                   0.27
FF 1.5.0.5                      52                   0.12
FF 1.5.0.6                     172                   0.41
FF 1.5.0.7                     499                   1.19
FF 1.5.0.8                    4383                  10.44
FF 1.6                           2                   0.00
FF 2.0                        5214                  12.42
FF 2.9.0.1                       1                   0.00
FF 3.0                           1                   0.00
FF ALL                       11304                  26.92
IE 3                             1                   0.00
IE 4                            27                   0.06
IE 5                           679                   1.62
IE 6                         15819                  37.67
IE 7                          3132                   7.46
IE ALL                       19658                  46.82

Solving IE6 Flicker Bug

Web Design No Comments »

In CSS, if you have ever worked with background-image rollovers, you will no doubt have found that Internet Explorer 6 tends to flicker when using “a:hover”.

After researching, the best way to combat this is to use an external javascript file in your section, like so:

<script type="text/javascript" src="/js/common.js"></script>

Then in common.js, use the following magic:

ie = document.all;
if(ie)
{
try {
document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
}

Your buttons should no longer flicker! Incidentally, IE7 has resolved this issue.

PHP Date Function

PHP, ASP No Comments »

The person that wrote the PHP Date function is a genious. I use it in almost every PHP application I write and its usage is so simple to work with. I have recently completed work on a booking calendar for www.tenerife-property-rentals.co.uk - which allows users to book any number of dates from an availability calendar. If it wasn’t for the mktime() and date(), it would have taken a long long time!

If anyone has an ASP alternative, please let me know.


© James Crooke 2000-2008
Entries RSS Login