However, I can not make it move smoothly as you can see a similar ads in this page
http://www.dantri.com.vn
Moreover, the float ads is not displayed in IE 7.0
Here is my code:
Code: Select all
<script type="text/javascript" language="JavaScript"><!-- Copyright 2001 William Bontrager
var Type = 'Z';
function StartFloat() {
if(document.all) {
document.all.AdFloater.style.pixelLeft = document.body.clientWidth - document.all.AdFloater.offsetWidth;
document.all.AdFloater.style.visibility = 'visible';
Type = 'A';
}
else if(document.layers) {
document.AdFloater.left = window.innerWidth - document.AdFloater.clip.width - 16;
document.AdFloater.visibility = 'show';
Type = 'B';
}
else if(document.getElementById) {
document.getElementById('AdFloater').style.left = (window.innerWidth - 130) + 'px';
document.getElementById('AdFloater').style.visibility = 'visible';
Type = 'C';
}
if (document.all) { alert('onscroll');window.onscroll = Float; }
else { setInterval('Float()', 100); }
}
function Float() {
if (Type == 'A') { document.all.AdFloater.style.pixelTop = document.body.scrollTop; }
else if (Type == 'B') { document.AdFloater.top = window.pageYOffset; }
else if (Type == 'C') {
document.getElementById('AdFloater').style.top = window.pageYOffset + 'px';
}
} //-->
Code: Select all
<span id="AdFloater" style="position: absolute; visibility: hidden; top: 1px;" align="right"><img src=""></span>Could you help me with the above prolems?