Forums

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

Home Forums CSS Auto-moving parallax background animation not working

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #41945
    pkmathanraj
    Member

    Hi everyone!
    In the Auto-moving parallax background, animation is not working.
    It was mentioned here,
    https://css-tricks.com/auto-moving-parallax-background/

    that “before we fire off the animation we have to reset the backgroundPosition within the JavaScript”.

    Exactly how do I do that? Can anyone help me with this?

    #120842
    Mottie
    Member

    Hi @pkmathanraj!

    The code is already in the example… this part of the code:

    $(‘#midground’).css({backgroundPosition: ‘0px 0px’});
    $(‘#foreground’).css({backgroundPosition: ‘0px 0px’});
    $(‘#background’).css({backgroundPosition: ‘0px 0px’});

    will reset the backgroundPosition.

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