javascript - popup an image and hide all index -
i making game (learning , experimental purpose). want game show "popup" image when lose, tryed hide divs not working... want when lose image displayed in same screen, such facebook images or twitter, background fades , image shown. in game, when lose, added image seems this:
function show_image() { var img = document.createelement("img"); img.src = 'images/firstblood.png'; img.width = 300; img.height = 300; // next line add <body> tag document.body.appendchild(img); }
the function above called when lose in game.
what want achieve more appending image html dom.
i know want keep simple, sake of it, checkout angularjs' ngshow. hide or show elements in dom structure whenever want them to.
a simple solution provided in this snippet of code. injects basic jquery library provides functionality show popup windows ease. follow code in snippet , should go.
Comments
Post a Comment