S
spolsky
try the the following code with Opera 9.01 (Windows). when clicked
slightly faster than normal clicking, the toggler checkbox and other
checkboxes displays differently although event method works fine to
update the checkboxes. there is not any problem with IE 6 or FireFox
1.5. also, i used the double click event method to see if its the
source but that does not help even. Opera 9.01 seems to be slow at
updating checkboxes visually. am i missing something or are there any
work arounds, solutions for this problem.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9"
/>
<title>Untitled Document</title>
</head>
<body>
<br />
<span id="span1"></span>
<br />
<span id="span2"></span>
<br />
<br />
<script>
var
clickCount = 0;
function toggleChecks(toggler)
{
clickCount++;
var oSpan1 = document.getElementById("span1");
oSpan1.innerHTML = "click : " + clickCount;
var
o = document.getElementsByName("selRow"),
chk = toggler.checked;
var len = o.length;
for (i = 0; i < len; i++)
{
o.checked = chk;
// check if really checked.
if (o.checked != chk)
alert("not set");
}
}
var
dblclickCount = 0;
function dblClick(toggler)
{
toggleChecks(toggler);
dblclickCount++;
var oSpan2 = document.getElementById("span2");
oSpan2.innerHTML = "double click : " + dblclickCount;
}
</script>
<input type="checkbox" id="chkToggle" onclick="toggleChecks(this);"
ondblclick="dblClick(this);" />
<label for="chkToggle">Toggle CheckBoxes (Rapidly click this within
Opera 9.01 and observe how check sync. loosed.)</label>
<br />
<input type="checkbox" name="selRow" value="114">
<br />
<input type="checkbox" name="selRow" value="115">
<br />
<input type="checkbox" name="selRow" value="116">
<br />
<input type="checkbox" name="selRow" value="117">
<br />
<input type="checkbox" name="selRow" value="118">
<br />
<input type="checkbox" name="selRow" value="118">
<br />
<input type="checkbox" name="selRow" value="119">
</body>
</html>
slightly faster than normal clicking, the toggler checkbox and other
checkboxes displays differently although event method works fine to
update the checkboxes. there is not any problem with IE 6 or FireFox
1.5. also, i used the double click event method to see if its the
source but that does not help even. Opera 9.01 seems to be slow at
updating checkboxes visually. am i missing something or are there any
work arounds, solutions for this problem.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9"
/>
<title>Untitled Document</title>
</head>
<body>
<br />
<span id="span1"></span>
<br />
<span id="span2"></span>
<br />
<br />
<script>
var
clickCount = 0;
function toggleChecks(toggler)
{
clickCount++;
var oSpan1 = document.getElementById("span1");
oSpan1.innerHTML = "click : " + clickCount;
var
o = document.getElementsByName("selRow"),
chk = toggler.checked;
var len = o.length;
for (i = 0; i < len; i++)
{
o.checked = chk;
// check if really checked.
if (o.checked != chk)
alert("not set");
}
}
var
dblclickCount = 0;
function dblClick(toggler)
{
toggleChecks(toggler);
dblclickCount++;
var oSpan2 = document.getElementById("span2");
oSpan2.innerHTML = "double click : " + dblclickCount;
}
</script>
<input type="checkbox" id="chkToggle" onclick="toggleChecks(this);"
ondblclick="dblClick(this);" />
<label for="chkToggle">Toggle CheckBoxes (Rapidly click this within
Opera 9.01 and observe how check sync. loosed.)</label>
<br />
<input type="checkbox" name="selRow" value="114">
<br />
<input type="checkbox" name="selRow" value="115">
<br />
<input type="checkbox" name="selRow" value="116">
<br />
<input type="checkbox" name="selRow" value="117">
<br />
<input type="checkbox" name="selRow" value="118">
<br />
<input type="checkbox" name="selRow" value="118">
<br />
<input type="checkbox" name="selRow" value="119">
</body>
</html>