Giter VIP home page Giter VIP logo

Comments (10)

pietschm avatar pietschm commented on July 20, 2024 6

A quick, but not perfect, solution could be overwriting the transform for smaller devices like this:

@media (max-width: 992px) { .rellax { transform: translate3d(0,0,0) !important; } }

from rellax.

moeamaya avatar moeamaya commented on July 20, 2024 2

@p-realinho and others. What do you guys think? I'm personally okay with adding a boolean option and re-using the landscape check to detect mobile, but I want to hear other's opinions.

from rellax.

moeamaya avatar moeamaya commented on July 20, 2024 2

Okay I think those are some good thoughts. I'll add some documentation to the README and close this issue later

from rellax.

nlemoine avatar nlemoine commented on July 20, 2024 1

Please don't provide a way to handle this feature such as many libraries do.

IMHO, the only requirement for any good library is to provide a destroy and init methods. It's then developer responsibility to handle the context where something happens or not.

And there's many easy ways to achieve this :

  • For a resolution context, media queries with matchMedia or the help of a matchMedia wrapper such as enquire.js.
  • For feature context, there's Modernizr or feature.js
  • And if you wanna target directly user agent, there's also some good libraries for this.

from rellax.

 avatar commented on July 20, 2024 1

i think this one goes with https://github.com/dixonandmoe/rellax/issues/58.
At least, I suggested this for disabling it on small viewports

from rellax.

hackuun avatar hackuun commented on July 20, 2024

Well, I guess @nlemoine makes a good point.
I don't see any methods to disable Rellax on mobile without bloating code (or how to detect mobile other ways?)
Maybe he is right. I need to do it myself and just remove rellax class, for example.

from rellax.

p-realinho avatar p-realinho commented on July 20, 2024

Yea, the feature can be useful in some cases, but at the same time I do agree with @nlemoine and the repo's KISS approach ...
Maybe an example snippet on the readme would suffice?

from rellax.

radiocity avatar radiocity commented on July 20, 2024

@iamdubx, do lazy load of rellax.js with an init callback for screen.availWidth > 860px only

from rellax.

hackuun avatar hackuun commented on July 20, 2024

@radiocity I want it loaded on Desktops with any screen width, for example.

Viewports and loading of Rellax is unrelated.
The only issue on mobiles - is address bar behavior.
So I need to detect mobile, but not the screen width.

from rellax.

radiocity avatar radiocity commented on July 20, 2024

@iamdubx, okay. Make a lazy load with mobile device validation.

from rellax.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.