Merhaba , ceviz.net üyeleri benim sorunum hali hazırda bildiğiniz sayfanın sol veya sağ köşelerinde çıkan sayfayı aşağı doğru (scroll)çektiğinizde sayfa ile aşağı kayan kutular div'ler.
Elimde bir reklam kutusu kodlarından uyarladığım bir kod var fakat değişik çözünürlüklerde sorun yaşıyorum , div in sayfada gösterileceği yer değişik çözünürlüklerde değişiyor.Denemediğim Yöntem Kalmadı nasıl bir çözüm yapabiliriz ?
Kodlar
Kod:
<HTML><HEAD><style type="text/css">
<!--
#sponsorAdDiv {position:absolute; height:1; width:1px; top:0; left:1;}
</style>
<script type="text/javascript">
adTime=15; // 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();
}
function 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+335+calunit;adDiv.top =documentHeight-390+calunit;
setTimeout("showAd()",100);}else closeAd();
}
function closeAd(){
if (ie||w3)
adDiv.display="none";
else
adDiv.visibility ="hide";
}
function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
onload=initAd;
</script>
</HEAD>
<BODY>
<div id="sponsorAdDiv" style="visibility:hidden">
<table width="300px" height="255px" bgcolor="#000000"><tr><td>
<table width="300px" height="250px" background="<?php print $img_base ?>left_menu.jpg"><tr>
<td align="left" valign="top" width="14">
İçerik
</td>
</tr>
<font></td></tr></table></td></tr></table>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="1500" height="1500">
<!-- MSTableType="layout" -->
<tr>
<td valign="top">
<!-- MSCellType="ContentBody" -->
</td>
<td height="798"> </td>
</tr>
<tr>
<td width="1055"> </td>
<td height="702" width="445"> </td>
</tr>
</table>
</BODY></HTML>