Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 19, 2022, 06:16:39 AM

Login with username, password and session length
Members
  • Total Members: 3843
  • Latest: Tricky
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 58
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 1
Guests: 46
Total: 47

Author Topic: A Random Picture/Banner Script  (Read 46608 times)

0 Members and 1 Guest are viewing this topic.

Mitchâ„¢

  • Guest
A Random Picture/Banner Script
« on: April 11, 2006, 04:34:21 PM »
WHAT:
A Random Picture/Banner Script

WHY:
Well I was looking for something like this but I couldnt find it.
So well I googled it. I like this one the best I did a lil bit of editing to it tidied it up.
There was no copyright that went with this so I am guessing it is ok to post it here.

WHERE:
http://www.crowes.f9.co.uk/Javascript/test.htm

Code: [Select]
<center>
<SCRIPT LANGUAGE="Javascript">
function banner() {} ; b = new banner() ; n = 0
b[n++]= "<A HREF='http://www.yoursite.com/'><IMG SRC='http://www.yoursite.com/image.jpg' BORDER='0' ALT=''></A>"
b[n++]= "<A HREF='http://www.yoursite.com/'><IMG SRC='http://www.yoursite.com/image.jpg' BORDER='0' ALT=''></A>"
b[n++]= "<A HREF='http://www.yoursite.com/'><IMG SRC='http://www.yoursite.com/image.jpg' BORDER='0' ALT=''></A>"
b[n++]= "<A HREF='http://www.yoursite.com/'><IMG SRC='http://www.yoursite.com/image.jpg' BORDER='0' ALT=''></A>"
b[n++]= "<A HREF='http://www.yoursite.com/'><IMG SRC='http://www.yoursite.com/image.jpg' BORDER='0' ALT=''></A>"
i=Math.floor(Math.random() * n) ;
document.write( b[i] )
</SCRIPT>
</center>
« Last Edit: April 11, 2006, 04:46:48 PM by Mitchâ„¢ »

PokerOwnage

  • Guest
Re: A Random Picture/Banner Scrip
« Reply #1 on: April 11, 2006, 04:39:24 PM »
nice one mitch!  i know nuke has this built into their portal system... where its easy to just go into admin and add banners and text etc etc... i hope/wonder if this is possible with smf, cause i know others at my site dont know how to edit code really haha

Mitchâ„¢

  • Guest
Re: A Random Picture/Banner Scrip
« Reply #2 on: April 11, 2006, 04:45:47 PM »
i hope/wonder if this is possible with smf, cause i know others at my site dont know how to edit code really haha

I am sure it would be possible. Over my head though. The editing of this is just pretty straight forward I thought.

PokerOwnage

  • Guest
Re: A Random Picture/Banner Script
« Reply #3 on: April 11, 2006, 04:49:59 PM »
yea... i do websites for people who hardly know how to browse the web haha

Offline G6Cad

  • Friends
  • *
  • Posts: 12643
    • FamiljeGodis
Re: A Random Picture/Banner Script
« Reply #4 on: April 12, 2006, 07:39:23 AM »
Nice Mitch :)
I have it all set up on my portal so now i can show my aqvarel art there to :)

atomz

  • Guest
Re: A Random Picture/Banner Script
« Reply #5 on: April 12, 2006, 07:40:33 AM »
nicee

Mitchâ„¢

  • Guest
Re: A Random Picture/Banner Script
« Reply #6 on: April 12, 2006, 08:09:40 AM »
Yay I am glad that I was helpful.

elpvn

  • Guest
Re: A Random Picture/Banner Script
« Reply #7 on: April 12, 2006, 08:17:00 AM »
It's nice for set as a dinamic logo but I like it get the pictures from a gallery than rather :)

Quote from: SlideShowScript
<SCRIPT LANGUAGE="JavaScript"><!--

var slideShowSpeed = 2000;
var fadeDuration = 3;

fadeimgarray = new Array();
fadeimgarray[0] = 'images/1.jpg';
fadeimgarray[1] = 'images/2.jpg';
fadeimgarray[2] = 'images/3.jpg';
fadeimgarray[3] = 'images/4.jpg';

var t
var j = 0

var preLoad = new Array()
for (i = 0; i < fadeimgarray.length; i++){
   preLoad = new Image()
   preLoad.src = fadeimgarray
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=fadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()     
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (fadeimgarray.length-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
//--></SCRIPT>

<BODY BGCOLOR="#FFFFFF" onLoad="runSlideShow()">

<IMG SRC="images/1.jpg" NAME="SlideShow" BORDER=0>

Demo here: http://www.crowes.f9.co.uk/Javascript/slideshow.htm ;)
« Last Edit: April 12, 2006, 08:22:08 AM by elpvn »

Mitchâ„¢

  • Guest
Re: A Random Picture/Banner Script
« Reply #8 on: April 12, 2006, 08:47:40 AM »
It's nice for set as a dinamic logo but I like it get the pictures from a gallery than rather :)

Quote from: SlideShowScript
<SCRIPT LANGUAGE="JavaScript"><!--

var slideShowSpeed = 2000;
var fadeDuration = 3;

fadeimgarray = new Array();
fadeimgarray[0] = 'images/1.jpg';
fadeimgarray[1] = 'images/2.jpg';
fadeimgarray[2] = 'images/3.jpg';
fadeimgarray[3] = 'images/4.jpg';

var t
var j = 0

var preLoad = new Array()
for (i = 0; i < fadeimgarray.length; i++){
   preLoad = new Image()
   preLoad.src = fadeimgarray
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=fadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()     
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (fadeimgarray.length-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
//--></SCRIPT>

<BODY BGCOLOR="#FFFFFF" onLoad="runSlideShow()">

<IMG SRC="images/1.jpg" NAME="SlideShow" BORDER=0>

Demo here: http://www.crowes.f9.co.uk/Javascript/slideshow.htm ;)


umm I thought I tired that one but it didnt work with larger images or maybe it was just me.

But I like this one cause it loads a different one on each page load which I needed since I am using it for ads/sponsers.

MADxMAX

  • Guest
Re: A Random Picture/Banner Script
« Reply #9 on: April 14, 2006, 08:49:52 AM »
if i try to use this i get an error,i think i got it the right way rounnd for the image location and the link,but any help or advice would be nice thnx

Code: [Select]
Parse error: syntax error, unexpected '<' in /home/madmax/public_html/forums/Sources/Load.php(1623) : eval()'d code(34) : eval()'d code on line 1
[/code