Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
var $, el;
// элемент, с которым будем манипулировать при показе\скрытии
// в старом IE это должен быть html
// в свежих браузерах - body
el = document.body;
if ("\v" == "v") {
  el = document.documentElement;
}
// при показе\скрытии просто меняем класс. остальное делает CSS.
function showModal() {
  el.className = "modal_showed";
}
function hideModal() {
  el.className = "modal_hided";
}
// укорочение
$ = function(x){return document.getElementById(x);};
  
$("close_modal").onclick = hideModal;
$("open_modal").onclick = showModal;
// при загрузке страницы надо скрыть окно.
hideModal();
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers