...

View Full Version : failing to retrieve target in FF



subhailc
12-17-2005, 07:09 AM
hi - this fails in FF when trying to get back the event target. why?

function getindex(a,b){for(var i=0;i<b.length;i++)if(b[i]==a)return i;return false;}

function el(a){
switch(typeof a){
case 'object' : case 'undefined' : return (window.event) ? event.srcElement : a.target;
case 'string' : return document.getElementById(a);
case 'number' : var b = document.getElementsByTagName('*'); return b[Math.max(0,Math.min(b.length-1,getindex(el(),b)+a))];
}}the bit in red is the trouble spot.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum