[jQuery] Clockpick + IE7 possible bug
Hello,
I’m brand new at web coding, although I’ve been a software developer
for many years. Therefore, I might be completely wrong about this,
but…
There seems to be a bug in clockpick 1.2.4 when using IE7 (not in
Firefox 3).
You can see what I’m talking about on the clockpick demo page at
http://www.oakcitygraphics.com/jquery/clockpick/trunk/ClockPick.cfm
In the second yellow time box (the one with the clock image beside it)
– use the clock to activate the picker and choose any time. Now click
anywhere in the same time field to focus the field. Now press any key
(ctrl, shift, arrows, tab, etc.) and you will get a script error in
this code, at the line that begins “h = (divtype == ‘minute’)…”
function keyhandler( e ) {
// $obj is current active div
var $obj = $("div.CP_over").size() ? $
("div.CP_over") : $("div.CP_hour:first"),
divtype = $obj.is(".CP_hour") ? 'hour' :
'minute',
hi = (divtype == 'hour') ?
$obj[0].id.split('_')[2] : 0, // hour index
h = (divtype == 'minute') ?
$obj[0].id.split('_')[0] : $obj[0].id.split('_')[1]; // real hour
if (divtype == 'minute')
{ var curloc = h<12 ? 'm1' : 'm2' }
else
{ var curloc = h<12 ? 'h1' : 'h2' }
The error message is “Microsoft JScript runtime error: '0.id' is null
or not an object”
I don’t know enough about javascript to understand the cause of the
problem, although it seems that $obj[0] must be undefined at the
moment of the error?
There are additional tidbits of information I’ve gathered in my
testing; if you need them just ask.
Thanks to anyone who can help,
Jeff