Javascript ile pop up div oluşturmak

function goster()
{
div=document.getElementById('div_popa');
div.style.display="block";
document.getElementById('div_ic').style.display="block";
div.style.pixelLeft=0;
div.style.pixelTop=0;
wid=document.body.clientWidth+"px";
heg=document.body.clientHeight+"px";
div.style.width=wid;
div.style.height=heg;
genis=Math.round( (parseInt(wid)-parseInt(document.getElementById('div_ic').style.width))/2);
document.getElementById('div_ic').style.pixelTop=100;
document.getElementById('div_ic').style.pixelLeft=350;

}
function sakla()
{
document.getElementById('div_popa').style.display="none";
document.getElementById('div_ic').style.display="none";
}

Burada div_popa ekranı tamamen kaplar ve div_ic ortada gözükecek asıl popup div dir.Eğer zemini belli oranda transparan yapmak isterseniz
.......opacity:.45;filter: alpha(opacity=45); -moz-opacity: 0.45;........
bu kodu div'in style'ına yazın.

Hiç yorum yok:

Yorum Gönder

Popüler Yayınlar