The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How to change DIV background image every 5 seconds?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #40624


    First post, my apologies if something like this has been answered, or if it’s a stupid question. I have been searching and cannot find the ebst solution to this problem! (I am assuming this a a javascript fix? But I could be wrong)

    The idea is that there will be a background image of a `

    ` that changes every 5 seconds.

    Currently, I have an image of width: 1600px that changes every 5 seconds, however when the window is too small, it creates scrollbars as it is not truly a background. I want to have the image as a background, centered, so any excess on the right and left will be left offscreen with no scroll bars.

    Any ideas???


    What about adding a min-width to that background, and use overflow:hidden?


    Aha! Thanks to both of you! Got it!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.