vForums Support Banner


Visit Base Classics - Gaming Chairs

 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: [F] Random Banner Convert - View Topic
Topic Rating: *****
Printable View
dog199200
Guest
[F] Random Banner Convert (22nd Feb 08 at 10:22pm UTC)
Quote:
<script type="text/javascript"><!--
/* random banner
- open source */
var images = []; var n = 0;

images[n++] = 'Image URL 1';
images[n++] = 'Image URL 2';
images[n++] = 'Image URL 3';

var r = Math.floor(Math.random() * images.length);
document.getElementsByTagName('img').item(0).src = images[r];
//-->
</script>


Can someone please convert the random banner code please? {Smile}

Edit: and once it is open source can someone please make it so that it wont show the same image twice in a row?
FreeUS
New Member
*

[Avatar]

Posts: 14
Status: Offline
Gender: Male
Location: California
Joined:  
Reputation: 0%  


pm
Re: Random Banner Convert (23rd Feb 08 at 2:06am UTC)
It already works.As for the repeating thing.There isn't much you can do.
dog199200
Guest
Re: Random Banner Convert (23rd Feb 08 at 2:10am UTC)
no it don't work all the way, it doesn't put the images in the boards logo cell like it is suppose to, it put the images right on top of that

http://deluxeanimeforum.vforums.co.uk/

go there and refresh it till you see the image and see for yourself.
FreeUS
New Member
*

[Avatar]

Posts: 14
Status: Offline
Gender: Male
Location: California
Joined:  
Reputation: 0%  


pm
Re: Random Banner Convert (23rd Feb 08 at 3:02am UTC)
Hmm.Thats right.I forgot proboards has the banner on the left and I coded my forum to be like that.We'll,i'll see what I can do.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Random Banner Convert (23rd Feb 08 at 3:04am UTC)
Use this for now...

Can't make it NOT show the image twice sorry! {Sad}

Code:
 
  1. <script type="text/javascript"><!--
  2. /* random banner
  3. - open source */
  4. var images = []; var n = 0;
  5.  
  6. images[n++] = 'Image URL 1';
  7. images[n++] = 'Image URL 2';
  8. images[n++] = 'Image URL 3';
  9.  
  10. var r = Math.floor(Math.random() * images.length);
  11. get('welcome_table','id').getElementsByTagName('img')[0].src = images[r];
  12. //-->
  13. </script>
 
dog199200
Guest
Re: Random Banner Convert (23rd Feb 08 at 3:22am UTC)
its ok, and thanks that should work, but is there a way to make it seems as if it load with the rest of the forum and not after it? It looks tacky seeing it appear after the rest of the forum finishes loading.
FreeUS
New Member
*

[Avatar]

Posts: 14
Status: Offline
Gender: Male
Location: California
Joined:  
Reputation: 0%  


pm
Re: Random Banner Convert (23rd Feb 08 at 3:30am UTC)
The exact solution I was about to use.Well,Wrighty beat me to it.
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 32
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Random Banner Convert (23rd Feb 08 at 6:01am UTC)
Posted By dog199200 on 23rd Feb 08 at 3:22am
 
its ok, and thanks that should work, but is there a way to make it seems as if it load with the rest of the forum and not after it? It looks tacky seeing it appear after the rest of the forum finishes loading.


Put it at the very top of your global header. {Wink}

rroll.to— Shorten a link, rickroll your friends.
dog199200
Guest
Re: Random Banner Convert (23rd Feb 08 at 6:04am UTC)
yay ty
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 32
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: [f] Random Banner Convert (23rd Feb 08 at 6:17am UTC)
Posted By dog199200 on 23rd Feb 08 at 6:04am
 
yay ty


No worries. {Smile}

rroll.to— Shorten a link, rickroll your friends.
 Printable View

All times are GMT+0 :: The current time is 7:53pm
Page generated in 0.2175 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums