How to use or call tags ( or global content blocks) in Javascript?
Posted: Wed May 09, 2007 12:21 pm
Here is the script ( floater layers). It show "{global_content name='footer'}" instead of content of the "footer". How do I modify it?
-------------------------
lastScrollY=0;
function ad(){
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
diffY = document.documentElement.scrollTop;
else if (document.body)
diffY = document.body.scrollTop
else
{/*Netscape stuff*/}
//alert(diffY);
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.getElementById("ad1").style.top=parseInt(document.getElementById
("ad1").style.top)+percent+"px";
document.getElementById("ad2").style.top=parseInt(document.getElementById
("ad1").style.top)+percent+"px";
lastScrollY=lastScrollY+percent;
//alert(lastScrollY);
}
ad1code="{global_content name='footer'}"
ad2code=""
document.write(ad1code);
document.write(ad2code);
window.setInterval("ad()",1);
-------------------
-------------------------
lastScrollY=0;
function ad(){
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
diffY = document.documentElement.scrollTop;
else if (document.body)
diffY = document.body.scrollTop
else
{/*Netscape stuff*/}
//alert(diffY);
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.getElementById("ad1").style.top=parseInt(document.getElementById
("ad1").style.top)+percent+"px";
document.getElementById("ad2").style.top=parseInt(document.getElementById
("ad1").style.top)+percent+"px";
lastScrollY=lastScrollY+percent;
//alert(lastScrollY);
}
ad1code="{global_content name='footer'}"
ad2code=""
document.write(ad1code);
document.write(ad2code);
window.setInterval("ad()",1);
-------------------