Grow your CSS skills. Land your dream job.

Javascript! Grayscale! Onload! What?

  • # December 22, 2012 at 12:42 pm

    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: http://www.legalcolors.co/works

    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?

    # December 22, 2012 at 5:22 pm

    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)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".