Problems with background image position on Stellar.js

前端 未结 4 1766
臣服心动
臣服心动 2021-01-15 12:35

I\'m using stellar.js to add a parallax effect to a vertical scrolling website, but I\'m having problems with the background positions. When I use the class \"data-stellar-b

相关标签:
4条回答
  • 2021-01-15 13:07

    Having the same issue I tried adding

    scrollProperty and horizontalScrolling
    

    Though this resulted in my background not being loaded.

    Removing both properties and running Stellar like..

    $.stellar({}) instead of $.stellar()
    

    (like on the Stellar site)

    Parallax is working like a charm.

    0 讨论(0)
  • 2021-01-15 13:27

    I had the same issue.

    In your jquery.stellar.js file change the stellar function so that horizontal scrolling is set to false (its set to true as default).

    $.stellar({
    horizontalScrolling:false
    // rest of function
    });
    
    0 讨论(0)
  • 2021-01-15 13:27

    I had the same problem and already had horizontalScrolling:false. Adding scrollProperty: 'transform' resolved the issue for me.

    0 讨论(0)
  • 2021-01-15 13:29

    Try changing scrollProperty to transform, like:

    scrollProperty: 'transform'
    

    That worked for me.

    0 讨论(0)
提交回复
热议问题