lcdsantos / jQuery-Selectric

jQuery plugin for easy manipulation and customization of HTML selects
http://selectric.js.org/
MIT License
727 stars 157 forks source link

Prevent standard select box from showing/loading on page load/refresh #102

Closed Adyyda closed 8 years ago

Adyyda commented 9 years ago

Hello. When the page loads (or is refreshed), for a fraction of a second (more on a slower connection), we can see the standard select box and than we see the proper selectric. Can it be changed so that we do not see the standard select box? I have managed to capture it with print screen

untitled

lcdsantos commented 9 years ago

You could do something like this, in your css:

select {
  visibility: hidden;
}

.selectric-hide-select select {
  visibility: visible;
}
Adyyda commented 9 years ago

Hello. Thanks for the reply. This issue is solved with the code you provided but i have found another issue. When i used the android gingerbread browser, the selectric select box was not present. So, your script is mobile compatible or not? Thanks In desktop i've set it up like i wanted and works nice.

lcdsantos commented 9 years ago

It's disabled by default on mobile browsers. You can change the option disableOnMobile to false if you want it working on mobile.

Adyyda commented 9 years ago

Can you tell me why you disable it on mobile? It mess something? Thanks

Adyyda commented 9 years ago

i have to change disableOnMobile:!0 in disableOnMobile:false ?

lcdsantos commented 9 years ago

Set this option when you're calling the plugin. Like this:

$('select').selectric({
  disableOnMobile: false
});

Don't modify the plugin file itself.

It's disabled by default because generally, the behavior of native <select> element on mobile is better, optmized for touch/small screens.

Adyyda commented 9 years ago

Hello again. I have applied and now the selectric select appears on mobile but, on click to expand it, we should see the normal android option select. I am telling this because i see the dropdown but i can't scroll down to chose another option. So, the script should show the converted select (just the main like Select a category) and use the android normal selection of value when you click on Select a category. Any ideea?

lcdsantos commented 9 years ago

This is not possible yet. Although, I have plans to implement this in future versions.

Adyyda commented 9 years ago

That is after me the only missing feature. Script works great even on ie8 but must be mobile compatible. Thanks for your support