35 lines
661 B
JavaScript
35 lines
661 B
JavaScript
function changeCheck(el)
|
|
|
|
{
|
|
var el = el,
|
|
input = el.getElementsByTagName("input")[0];
|
|
|
|
if(input.checked)
|
|
{
|
|
el.style.backgroundPosition="0 0";
|
|
input.checked=false;
|
|
}
|
|
else
|
|
{
|
|
el.style.backgroundPosition="0 -17px";
|
|
input.checked=true;
|
|
}
|
|
return true;
|
|
}
|
|
function startChangeCheck(el)
|
|
|
|
{
|
|
var el = el,
|
|
input = el.getElementsByTagName("input")[0];
|
|
if(input.checked)
|
|
{
|
|
el.style.backgroundPosition="0 -17px";
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function startCheck()
|
|
{
|
|
|
|
startChangeCheck(document.getElementById("niceCheckbox1"));
|
|
} |