I have 0 experience in JavaScript and only one class worth of HTML. Below is what I "think" is the code for a widget on my website. It's just a guild website for a video game.


It may be easier to view the site and look at the widget directly(not sure that can be done, I pulled the code from the view page source)

It shows a small preview image of gallery pictures and cycles through them randomly. What I would like to do is somehow do the same thing this gallery viewing is doing but instead have the background changing on the site. I think I can save the code into a new CSS and use that to link for the background images on the site however when I tried to do it that way it didn't work and actually made a few things go crazy so I had to delete it and reset a couple things.


<script type="text/javascript">
var imgList;
var imgDescList;
var imgWrapperAnchor;
var imgHolder;
var galleryPaused = false;
var imgSlideIn;

var rotateImages = function() {

if (!galleryPaused)
if (imgList != null && imgList.length != null && imgList.length > 0)
var ranNum = Math.floor(Math.random()*5);
var currentImg = imgList[ranNum];
showGalleryImage(currentImg.toString(), imgDescList[ranNum].toString());

var showGalleryImage = function(sGalleryImgPath, sDescription) {
imgHolder.fadeOut('3500', function() {
imgHolder.attr("src", sGalleryImgPath);
imgHolder.bind("click", function() { openImage(sGalleryImgPath.replace("asxthumb_", "").replace("axst_", ""), sDescription); });
imgHolder.fadeIn('2500', function() {

} );

var setGalleryTimer = function() {
setTimeout("rotateImages()", 9000);

jQuery(document).ready( function() {
imgHolder = jQuery("#imgGalleryImage");
imgWrapperAnchor = jQuery("#imgWrapperAnchor");
imgList = new Array(5);
imgDescList = new Array(5);
imgList[0] = "/GuildFiles/447231/Broken_Ring.jpg";
imgDescList[0] = "Image uploaded by Rezna";
jQuery("<img>").attr("src", "/GuildFiles/447231/Broken_Ring.jpg").attr("width", "152px").attr("height", "167px");
imgList[1] = "/GuildFiles/447231/Asura_Male_Guardian.jpg";
imgDescList[1] = "Image uploaded by Rezna";
jQuery("<img>").attr("src", "/GuildFiles/447231/Asura_Male_Guardian.jpg").attr("width", "152px").attr("height", "167px");