CSS | JAVASCRIPT | Popup onload site





Hari ni aku boring giler...so bek aku buat tutorial css, ada gak fekdah nya...huhu...Ok let's go!

1. ni code CSS nye. Letak dlm < s t y l e > letak sini< / s t y l e>< / h e a d >
#sponsorAdDiv {

position:absolute;
height:1;
width:1px;
top:0;
left:0;
}
#sponsorAdDiv a{
color:#009;
text-decoration:none;
}
#blanket {
top:0;
left:0;
right:0;
bottom:0;
position:absolute;
width:100%;
background-color:#000;
/* for IE */
filter:alpha(opacity=60);
/* CSS3 standard */
opacity:0.6;
margin:auto;
}

2. Javascript : ni letak sebelum tag < b o d y >

< s c r i p t t y p e ="text/javascript">



adTime=100; // seconds ad reminder is shown
chanceAd=1; // ad will be shown 1 in X times (put 1 for everytime)

var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"
adCount=0;
function initAd(){
if(!ns && !ie && !w3) return;
if(ie) adDiv=eval('document.all.sponsorAdDiv.style');
else if(ns) adDiv=eval('document.layers["sponsorAdDiv"]');
else if(w3) adDiv=eval('document.getElementById("sponsorAdDiv").style');
randAd=Math.ceil(Math.random()*chanceAd);
if (ie||w3)
adDiv.visibility="visible";
else
adDiv.visibility ="show";
if(randAd==1) showAd();
}
funct ion showAd(){
if(adCount < adTime*10){adCount+=1; if (ie){documentWidth =truebody().offsetWidth/2+truebody().scrollLeft-20; documentHeight =truebody().offsetHeight/2+truebody().scrollTop-20;} else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20; documentHeight=window.innerHeight/2+window.pageYOffset-20;} else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20; documentHeight=self.innerHeight/2+window.pageYOffset-20;} adDiv.left=documentWidth-200+calunit;adDiv.top =documentHeight-200+calunit; setTimeout("showAd()",100);}else closeAd(); } funct ion closeAd(){ if (ie||w3) { document.getElementById("blanket").style.visibility="hidden"; adDiv.display="none"; } else { document.getElementById("blanket").style.visibility="hidden"; adDiv.visibility ="hide"; } } functi on truebody(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body } onload=initAd; functi on hidebox(){ document.getElementById("sponsorAdDiv").style.visibility="hidden"; document.getElementById("blanket").style.visibility="hidden"; }



3. Display text popup: letak sebelum tag < / b o dy> THIS CODE NOT WORK PROPERLY...please download the file given.

< di v onclick="hidebo x();return false" id="bl anket"> 

< d iv id="sponsorAdDiv" style="visibility:hidden">
< tab le style=" border-collapse: collapse" bgcolor="#FAC205" border="1" cellpadding="5" height="375px" width="555px">< tbody>< tr>< td>
< tab le bgcolor="#000" border="0" height="100%" width="100%">< tr>< td>

< ta ble bgcolor="#fff" border="0" height="100%" width="100%">< tb ody>< tr>< td style="padding:10px;" align="center" valign="middle">

< !--*****EDIT THIS MESSAGE*****-- >
< a href='juongjournal.blogspot.com'>Juong Journal click here< / a>
< !--*****EDIT THE ABOVE MESSAGE*****-- >
< / td>< / tr>< / tbody>< / ta ble >< / td>< / tr>< / tbody>< / ta ble>< / td>< / tr>< / tbody>< / t able>
< / di v>


Popular Posts

.

Sila Klik, Untuk  Menempah Web Profesional!
Facebook Page
Facebook Page
Back to Top