Skip to content

Instantly share code, notes, and snippets.

@tivac
Forked from anonymous/gist:367346
Created April 15, 2010 16:51
Show Gist options
  • Save tivac/367349 to your computer and use it in GitHub Desktop.
Save tivac/367349 to your computer and use it in GitHub Desktop.
function moveIt(checkbox) {
var pos = checkbox.value,
moz = document.getElementById('moz'),
moz1 = document.getElementById('moz1'),
moz2 = document.getElementById('moz2'),
moz3 = document.getElementById('moz3');
switch (pos) {
case "nw" :
moz.style.visibility = (checkbox.checked === true) ? "visible" : "hidden";
break;
case "ne" :
moz1.style.visibility = (checkbox.checked === true) ? "visible" : "hidden";
break;
case "se" :
moz2.style.visibility = (checkbox.checked === true) ? "visible" : "hidden";
break;
case "sw" :
moz3.style.visibility = (checkbox.checked === true) ? "visible" : "hidden";
break;
default:
alert('not possible');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment