Sign Up! Login: Password: New User? Forgot? Support
Top Mods!
Wowhead Search
by sonofsamedi
Digital Clock
by Wolfar15
Admin Forums
Welcome to the GuildPortal Help Community! These forums are for admin-to-admin help.
Available Forums
Forums : Voodoo Tech and Scripter's Den of Scriptniquity > Random Banner Builder Background Image on Page Reload
Mottie (MVP) 4/9/2011 12:04 PM EST : Random Banner Builder Background Image on Page Reload
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Random Banner Builder Background Image on Page Reload

This script will randomly replace the banner builder background image on page reload.

Add this script to your Banner or Footer Area (Control Panel > Custom HTML & Script > Banner (or Footer) Area)

Code
<script type="text/javascript">
 var images = [];
 /*********************************
  Add images: images.push (["Add URL here"]);
 **********************************/

 images.push (["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/styles/bkgd_cobblestone.gif"]);
 images.push (["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/styles/bkgd_dirt.gif"]);
 images.push (["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/styles/bkgd_floor.gif"]);
 images.push (["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/styles/bkgd_grass.gif"]);
 images.push (["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/styles/bkgd_lava.gif"]);
 images.push (["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/styles/bkgd_outland2.gif"]);

 // ********************************
 // Don't change anything below this line
 // ********************************
var inc = Math.floor( Math.random() * images.length );
$('#bannerCell').css('background-image', 'url(' + images[inc] + ')');
</script>
Customizing
  • Add more images using this template. Make sure you are using both the parenthesis, brackets and quotes around the URL (in orange)

    images.push (["full image URL"]);
TopBottom

Mottie (MVP) 4/9/2011 12:14 PM EST : Random Banner Builder Title Image on Page Reload
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Random Banner Builder Title Image on Page Reload

This script will randomly replace the banner builder title image on page reload. And yes, you can combine it with the background image code above. 

Add this script to your Banner or Footer Area (Control Panel > Custom HTML & Script > Banner (or Footer) Area)

Code
<script type="text/javascript">
 var images2 = [];
 /*********************************
  Add images: images.push (["Add URL here"]);
 **********************************/

 images2.push (["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/styles/HelpSite.png"]);
 images2.push (["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/styles/title.png"]);
 images2.push (["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/styles/test-site3.png"]);
 images2.push (["http://i201.photobucket.com/albums/aa236/Mottie1/testsite/styles/test-site4.png"]);
 images2.push (["http://www.axiomfiles.com/Images/Dynamic/3780.png"]);

 // ********************************
 // Don't change anything below this line
 // ********************************
var inc = Math.floor( Math.random() * images.length );
$('#containedBanner').attr('src', images2[inc]);
</script>
Customizing
  • Add more images using this template. Make sure you are using both the parenthesis, brackets and quotes around the URL (in orange)

    images2.push (["full image URL"]);
TopBottom

deerhunter666 (Guild Admin) 11/23/2012 11:29 PM EST : RE: Random Banner Builder Title Image on Page Reload
deerhunter666
Posts: 69
Posts With Wolves

Does not work for me...
My normal banner (a image) just disappears..

TopBottom

Admins Online
There are   members online.
So-and-so has logged on!
%title%
%message%