Announcement

Collapse
No announcement yet.

Roatating images in header on refresh

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roatating images in header on refresh

    i was able to do so on my old YaBB forum using this code...
    Code:
    <IMG SRC="http://www.highperformancetoys.com/webheader/web header alpha.jpg" NAME="myPicture">
    Code:
    <!-- Hide script from old browsers
    Code:
    var myPix = new Array("http://www.highperformancetoys.com/webheader/web header1.jpg", "http://www.highperformancetoys.com/webheader/web header2.jpg", "http://www.highperformancetoys.com/webheader/web header black box.jpg", "http://www.highperformancetoys.com/webheader/web header 69camaro.jpg", "http://www.highperformancetoys.com/webheader/web header mach1.jpg", "http://www.highperformancetoys.com/webheader/69 camaro header.jpg",
    Code:
    function choosePic() {
    Code:
    if (document.images) {
    Code:
    randomNum =
    Code:
    Math.floor((Math.random() * 100)) % 22
    Code:
    document.myPicture.src = myPix[randomNum]
    Code:
    }
    Code:
    }
    Code:
    // End hiding script from old browsers -->
    Code:
    </SCRIPT>
    I cannot get this to work on the Vb forum, or maybe i just cant find the right place to add it..

    it doesn't have to be that code...if someone knows something that may work better for Vb

    all it does it rotate out the banner onthe forum at every refresh, regaurdless of what page you were on....i'd be happy if it would just work on the front page

    Help please, the Vb coding is new to me, and is giving me a hard time!

    webmaster of www.highperformancetoys.com

  • #2
    Are you trying to create a 'random' image everytime OR it rotates through all the images. (i.e. 1, 3, 1, 4, 2, 3 OR 1, 2, 3, 4, 1, 2)

    Comment


    • #3
      Random image on every refresh/click

      basically each time the page is loaded, a randon image from a source directory is loaded

      Comment


      • #4
        ANyone else know how i could do this?

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X