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

Home Forums JavaScript Javascript! Grayscale! Onload! What?

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

    Hi everyone,

    Long-time lurker, first-time poster. I’m a designer who knows a little HTML and CSS but absolutely no JS. I threw together a site last week as a simple portfolio for some of my work. I don’t have much on there yet, but the link is as follows:

    THE PROBLEM, THOUGH, IS: the page loads before the grayscale-to-color javascript loads, so it displays in full color, then in grayscale, and I think it looks unprofessional. Like I said, I usually don’t post, but I’m throwing my hands up on this one. Any thoughts?


    Hi @ashenrose

    I’m on my phone so it’s hard to tell really but it sounds like the function is loading when the document is ready i.e. when all the elements on the page load – then do this function.

    To overcome this you could change the script/function to run when the window is loaded like `(window).onload` rather than `(document).ready`. I think that will sort it, but I could be wrong…

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