Lecture Notes 05 Oct 2016 # Java Script Code to show and hide elements Visibility Control


function flipImage () { elt = document.getElementById("galaxy").style; if (elt.visibility == "visible") elt.visibility = "hidden"; else elt.visibility = "visible"; } # Java Script code to stack elements to change visibility Dynamic stacking of images

var oldTop = "lake"; function toTop(newTop) { domTop = document.getElementById(oldTop).style; domNew = document.getElementById(newTop).style; domTop.zIndex = "0"; domNew.zIndex = "40"; oldTop = newTop; }