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

Home Forums JavaScript Animated Background Vertical orientation

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

    Borrowed this bit of code to make an animated gradient animation. It’s all working fine, but I’m trying to figure out how I can make the animation run vertical as opposed to horizontal (how it’s running now). Unfortunately I don’t know enough about javascript to change it. Any help is greatly appreciated!

    link to animation (


    Just change the CSS rule it’s adding

    "-webkit-gradient(linear, left top, right top, from("+color1+"), to("+color2+"))"

    To this:

    "-webkit-gradient(linear, left bottom, left top, from("+color1+"), to("+color2+"))"

    This runs it from bottom to top. Just reverse the start/end parameters to go from top to bottom.

    Don’t forget to do the same for the Mozilla prefixed rule -moz as well. I’m on Chrome right now so I’ll leave looking that syntax up to you.


    Ah! Perfect, thank you!

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