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: unlikely image message

        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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -