Code Monkey home page Code Monkey logo

Comments (3)

adamcoulombe avatar adamcoulombe commented on August 16, 2024

This is probably because the plugin doesn't run until document.ready which sometimes takes longer to fire on mobile on account of slower download and processor speeds. I don't have a good failsafe way to remedy with JS, but one thing you could do is set the opacity of the select element to 0 using css (example), this way, you wont see the unstyled element.

The only problem however is that this causes the select element to no longer degrade gracefully as users with no JS enabled would not see the select box at all. May not be an issue if your site only supports JS users.

I'll leave this issue open in case anyone else has any other suggestions

from jquery.customselect.

g5604 avatar g5604 commented on August 16, 2024

thank you, this solution works well. It is a shame it no longer degrades gracefully, but as I am only using the select menu on mobile it is unlikely JS will not be turned on.

from jquery.customselect.

mpettitt avatar mpettitt commented on August 16, 2024

One option if you do need graceful degradation would be to add a "no-js" class to the body element, style your select list for non-js using browsers, then remove the no-js class in your script, causing the select list to be hidden. You can do the removal as soon as you know whether JS is enabled or not, which can even be in the rendering phase (script element just after opening <body> tag, removing no-js if it runs)

from jquery.customselect.

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.