real *nix devs don't test in IE
Saturday, 17. February 2007, 17:14:00
// Cross-browser implementation of element.addEventListener()
function addEventListener(element, type, expression, bubbling) {
bubbling = bubbling || false;
if (window.addEventListener) { // Standard
element.addEventListener(type, expression, bubbling);
return true;
} else if (window.attachEvent) { // IE
element.attachEvent('on' + type, expression);
return true;
} else return false;
}Whoever wrote that obviously is confused about event bubbling versus event capturing (luckily it defaults to a sensible false!) but the main problem with this code is the line
if (window.addEventListener) { // StandardUm, no, what you are seeing there is not the W3C standardised window.addEventListener1. You're actually checking for the existence of this very function - the one we're inside when we hit that statement. Naturally IE chokes on the next line and no event handlers are added. (If you ask, it should read if(element.addEventListener).)
So - a slick, good-looking production site that wasn't tested with IE - what a rarity!
Edit - note 1: well, actually W3C didn't specify addEventListener for window in the first place, it remains a Gecko extension like I've complained about earlier so the comment "// Standard" is doubly wrong..
EDIT: and if you hover over the feature screenshots, the magnified version that should pop up right where the mouse is actually appears at the very bottom of the page. Too bad if that part is not shown on the screen at the moment.
Hope the program works better than their site.
By WildEnte, # 17. February 2007, 18:26:07
The feature screenshots problem is what I actually was investigating. The site tries to position the screenshots by reading "x" and "y" properties from the IMG element you hover. I don't know why IMG elements (only?!) have .x and .y in Firefox, it looks like a Netscape 4 feature they've kept for some reason..?
By hallvors, # 18. February 2007, 14:07:48
It would have helped in this case if the global object had a more accurate name. It isn't apparent to beginners that objects created in the global namespace are added as properties to an object named "window".
By HeroreV, # 18. February 2007, 21:16:03
Originally posted by WildEnte:
Same issue as wordpress. Floated links with big margin-bottom.By xErath, # 19. February 2007, 08:41:42
Also note that IE/Mac doesn't support either addEventListener or attachEvent
By crisp, # 19. February 2007, 22:59:13
By tarquinwj, # 1. March 2007, 21:48:48