The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Hey guys,
whats the code to make random logos appear? Thanks Reece is it just a simple code? Cheers can anyone tell me? I need to find out by friday. |
|
#2
|
|||
|
|||
|
Try JavaScript Random Image Code, should be able to find easy enough
|
|
#3
|
|||
|
|||
|
Rudi, LOL, i've fixed it. and you knew i had to code.
For all members: Code:
<script language="JavaScript">
<!--
// Create arrays to contain all the values
// for image locations
image = new Array
image[1]="http://us.yimg.com/images/yahoo.gif"
image[2]="http://www.excite.com/mesp/images/excite/new_logo-180.gif"
image[3]="http://a284.g.akamai.net/7/284/987/000/lygo.com/ly/i/lyguide.gif"
image[4]="http://cnet.com/Images/Headers/cnet-1-title.gif"
image[5]="http://webcrawler.com/img/web/hdr/home_header.gif"
// Create a random number between 1 and five
random_num = (Math.round((Math.random()*4)+1))
// Write the image tag with a random array element
document.write("<img src=\"" + image[random_num] + "\">");
-->
</script>
|
|
#4
|
||||
|
||||
|
Quote:
Just wanted to get an update Just want to get an update to my reply |
|
#5
|
|||
|
|||
|
Quote:
But remember to change the random number array to comply with the image amount ![]() eg. 2 images Code:
// Create a random number between 1 and five random_num = (Math.round((Math.random()*1)+1)) Another small thing... To remove the borders of the images, replace Code:
document.write("<img src=\"" + image[random_num] + "\">");
Code:
document.write("<img src=\"" + image[random_num] + "\"border="0">");
|
|
#6
|
|||
|
|||
|
Yeah Rudi it's pretty much straight fodward.
If you have any worries, PM me. Reece |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|