Skip to main content

Forums

This topic contains 18 replies, has 11 voices, and was last updated by  hhalter 2 months, 3 weeks ago.

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #279755

    docwest
    Participant

    Rather then 10 seconds how about 24 hours a new background.

    #279757

    Shikkediel
    Participant

    I think that would either have to be coded server side (in case the page is not served with only HTML but is inserted with PHP for example) or if you want an approach on the user’s end, you could go with window.localStorage and check the last time the page was visited – if that was more than a day ago, then change the background.

    #280907

    sagarleo1
    Participant

    Hii, I have given you the code (JavaScript), try it yourself and share the result

    var i = 0;
    function change() {
    var doc = document.getElementById(“background”);
    var color = [“black”, “blue”, “brown”, “green”];
    doc.style.backgroundColor = color[i];
    i = (i + 1) % color.length;
    }
    setInterval(change, 1000);

    &nbsp
    #283553

    hhalter
    Participant

    This is awesome! I need some help adding a sliding transition for each image. I don’t like how it just flashes to the next image.

    Thanks!

Viewing 4 posts - 16 through 19 (of 19 total)

You must be logged in to reply to this topic.

icon-link icon-logo-star icon-search icon-star