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?
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
Posts: 14 Status: Offline Gender: Male Location: California Joined:
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
Posts: 14 Status: Offline Gender: Male Location: California Joined:
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
Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
pmvForum | 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!
Code: - <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);
- get('welcome_table','id').getElementsByTagName('img')[0].src = images[r];
- //-->
- </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
Posts: 14 Status: Offline Gender: Male Location: California Joined:
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
pmwww | Re: Random Banner Convert (23rd Feb 08 at 6:01am 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.
Put it at the very top of your global header. | |
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
pmwww | Re: [f] Random Banner Convert (23rd Feb 08 at 6:17am UTC) | |
No worries. | |
rroll.to— Shorten a link, rickroll your friends. |
|