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

Home Forums JavaScript changing the website background every time

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #188606
    Rohith Nampally

    Hello every one
    I have created a website i want to change it in different look
    suppose, for 1st time if i open my website background should be with image 1 and if i open it again the background should be changed with image 2 & if i open it again the background should be changed with image 3…..

    if i open it for 10th time the background should come with image 10…
    please help me i am new for javascript please give me perfect answer

    Thanks in Advance…



    You might want to think about using a forum name instead of leaving your email address for everyone to read.

    For your specific request this is not a simple JS issue. you need to be able to generate and retrieve cookies in order to store the number of each users’ visits.

    A google search would be more appropriate than posting a vague request with, apparently, no previous research or attempt made.

    Rohith Nampally

    Thank you bro


    Frankly websites that are different every time I visit them annoy me…in general people don’t like change and prefer consistence.

    As an alternative to cycling through a list of colors which would require (I think) cookies…you might want to just apply a random color from a color array.

    It would be virtually the same and it’s extremely unlikely that anyone would notice that there is a list of colors anyway.

    That’s just a tiny piece of Jquery…

    See this JSfiddle and press Run a few times.

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