You can put this in a scriptbox
To use for banners or affiliate ads
Demo (http://www.phpshiva.nl/)
<script language="JavaScript1.2">
//you can alter the width here (in pixels)
var sliderwidth=600
//you can alter the heigt here (in pixels )
var sliderheight=100
//you can alter the seed here (higher is faster)
var slidespeed=4
var leftrightslide=new Array()
var finalslide=''
// alter below your url's (a href ) and the pictures (img scr )
leftrightslide[0]='<a href="http://www.yoursite.com"><img src="http://www.yoursite.com/bannerhere" width="468" height="60" border=0></a>'
leftrightslide[1]='<a href="www.yoursite.com"><img src="http://www.yoursite.com/bannerhere" width="468" height="60" border=0></a>'
leftrightslide[2]='<a href="www.yoursite.com"><img src="http://www.yoursite.com/bannerhere" width="468" height="60" border=0></a>'
leftrightslide[3]='<a href="www.yoursite.com"><img src="http://www.yoursite.com/bannerhere" width="468" height="60" border=0></a>'
///////Dont alter below////////////////////////////////////
var copyspeed=slidespeed
for (i=0;i<leftrightslide.length;i++)
finalslide=finalslide+leftrightslide[i]+" "
if (document.all){
document.write('<marquee id="ieslider" scrollAmount=0 style="width:'+sliderwidth+'">'+finalslide+'</marquee>')
ieslider.onmouseover=new Function("ieslider.scrollAmount=0")
ieslider.onmouseout=new Function("if (document.readyState=='complete') ieslider.scrollAmount=slidespeed")
}
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
document.ns_slider01.visibility="show"
setTimeout("window.onresize=regenerate",450)
intializeleftrightslide()
}
if (document.all)
ieslider.scrollAmount=slidespeed
}
function intializeleftrightslide(){
document.ns_slider01.document.ns_slider02.document.write('<nobr>'+finalslide+'</nobr>')
document. ns_slider01.document.ns_slider02.document.close()
thelength=document.ns_slider01.document.ns_slider02.document.width
scrollslide()
}
function scrollslide(){
if (document.ns_slider01.document.ns_slider02.left>=thelength*(-1)){
document.ns_slider01.document.ns_slider02.left-=slidespeed
setTimeout("scrollslide()",100)
}
else{
document.ns_slider01.document.ns_slider02.left=sliderwidth
scrollslide()
}
}
window.onload=regenerate2
//-->
</script>
<ilayer width=&{sliderwidth}; height=&{sliderheight}; name="ns_slider01" visibility=hide>
<layer name="ns_slider02" onMouseover="slidespeed=0;" onMouseout="slidespeed=copyspeed"></layer>
</ilayer>
this will slide your banners from right to left .
and its easy to put more banner in it
Please repost your code, and this time, in code tags as the code render wrongly with out it.
Also, i will move this to the proper board.
Sorry for that G6
Did the tags now
Thank you :up:
Looks great ! I can't understand the top that is commented out. Doest that part matter?
Or could someone translate?
there is nothing comment out
i translated the code for you
have fun
you did a great job, thanks for sharing, phpshiva :D
Thank you. Looks very useful.
Your welcom
you can add more banners like this
leftrightslide[4]='<a href="www.yoursite.com"><img src="http://www.yoursite.com/bannerhere" width="468" height="60" border=0></a>'
leftrightslide[5]='<a href="www.yoursite.com"><img src="http://www.yoursite.com/bannerhere" width="468" height="60" border=0></a>'
Greetz phpshiva
Thanks. I think I will use this for featured affiliates. The ones that deserve the big banners.
Edit: I think I might add an "alt" tag in there to make the spiders happy as well as people with slow connections.
Hello, :)
I tried inputting this code into a scriptbox, but the result is just an empty box. The only code that I edited was the URL specification area.
I'm currently using SMF 1.1.7 and TinyPortal v1.0.5 beta 1.
iff you did it ok than i should show try to look if you left out something in the code
just try to copy code again and alter url again.
Well I gave it another try, but the same result occurs no matter what I do. I have one other scriptbox that's running my Slideshow, which is operating perfectly.
In case you're wondering, I'm using Firefox 3.
do you see the demo on my site? if that is working than yours works to
No go here either. I added just 1 url with an image link, I commented out the rest of the links.
The block shows, but there is no height to it. You can see it here on top, above the news box.
http://www.sbmtrader.com/index.php (http://www.sbmtrader.com/index.php)
Edit. I also changed the default image dimensions to fit the size of my image.
this is what i am finding on your site phpshiva..
Ok, the problem is that this snippet has a browser incompatibility issue. I just checked it using Internet Explorer 7 and everything seems fine. This snippet won't do much good until it's Firefox 3 friendly as well.