popup an element from one click


/ Published in: JavaScript
Save to your folder(s)

This I will use for popping up the login and profile info


Copy this code and paste it in your HTML
  1. function popup() {
  2. var id = document.getElementById(ID);
  3. var screenW = document.body.clientWidth;
  4. id.style.left = (screenW - 850)/2 + 515 + "px";
  5. if (id.style.display == "none") {
  6. id.style.display = "block";
  7. }
  8. else {
  9. id.style.display = "none";
  10. }
  11. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.