TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 19, 2024, 05:07:54 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 266
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 174
  • Total: 174

A Random Picture/Banner Script

Started by Mitchâ„¢, April 11, 2006, 11:34:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mitchâ„¢

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



<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>


PokerOwnage

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â„¢

Quote from: PokerOwnage on April 11, 2006, 11:39:24 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

yea... i do websites for people who hardly know how to browse the web haha

G6Cad

Nice Mitch :)
I have it all set up on my portal so now i can show my aqvarel art there to :)


Mitchâ„¢


elpvn

#7
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 ;)

Mitchâ„¢

Quote from: elpvn on April 12, 2006, 03:17:00 PM
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

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


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