Javascript - Pop Up Script


SUBMITTED BY: Guest

DATE: June 14, 2013, 3:54 p.m.

FORMAT: JavaScript

SIZE: 892 Bytes

HITS: 1414

  1. <!DOCTYPE html>
  2. <html>
  3. <head><title></title>
  4. <script>
  5. function popUp() {
  6. var popDiv = document.getElementById("popDiv");
  7. popDiv.style.display = "block";
  8. popDiv.style.width = "500px";
  9. popDiv.style.height = "300px";
  10. popDiv.style.position = "absolute";
  11. popDiv.style.top = "50%";
  12. popDiv.style.left = "50%";
  13. popDiv.style.margin = "-150px 0 0 -200px";
  14. popDiv.style.background = "white";
  15. popDiv.style.fontSize = "1.3em";
  16. popDiv.style.border = "thick solid black";
  17. popDiv.style.padding = "20px 60px";
  18. popDiv.innerHTML = "<img src=\"myimage.jpg\">";
  19. }
  20. </script>
  21. </head>
  22. <body>
  23. <div id="popDiv"></div>
  24. <button onclick="popUp();">Click Me</button>
  25. </body>
  26. </html>

comments powered by Disqus