TinyPortal

Development => Block Codes => Topic started by: rebelrose on January 08, 2007, 07:21:04 PM

Title: Need a script for banners
Post by: rebelrose on January 08, 2007, 07:21:04 PM
I need to find a script or something like it that makes banners scroll down the screen with the browser/user as they scroll down, anyone have one or know of one?
Title: Re: Need a script for banners
Post by: knat on January 08, 2007, 07:41:08 PM
hmm sounds like you need some javascript or something.. check out http://www.dynamicdrive.com/dynamicindex4/flyimage2.htm

Or maybe one of the other sripts on that site  ;)
Title: Re: Need a script for banners
Post by: rebelrose on January 08, 2007, 07:52:09 PM
alright thanks I will look.
Title: Re: Need a script for banners
Post by: knat on January 08, 2007, 08:11:48 PM
But i must warn you that that is one of the most anoying things you can do to your users  ;D next to pop-ups  :2funny:
Title: Re: Need a script for banners
Post by: rebelrose on January 08, 2007, 08:13:31 PM
It is not for me, so I am not concered  :2funny:  I hate those things
Title: Re: Need a script for banners
Post by: Lesmond on January 08, 2007, 09:00:35 PM
I got this Reb, it was for a floating menu, but I have used it for img as well.
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>

<!--EDIT BELOW TO PLACE YOUR CODE -->
<table border="0" width="130" cellspacing="0" cellpadding="0" bgcolor="">
  <tr>
    <td width="100%">
<!--PLACE YOUR CODE HERE-->   
  </td>
  </tr>
</table>
<!--END OF EDIT-->

<script type="text/javascript">



//Enter "frombottom" or "fromtop"
var verticalpos="fromtop"

if (!document.layers)
document.write('</div>')

function JSFX_FloatTopDiv()
{
var startX = 3,
startY = 150;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
[/code/
Title: Re: Need a script for banners
Post by: rebelrose on January 08, 2007, 09:02:43 PM
Thanks Les.  :)