getgrav / grav-plugin-lightslider

Grav LightSlider Plugin
https://getgrav.org
MIT License
14 stars 15 forks source link

Disable lightslider #6

Closed mario8119 closed 9 years ago

mario8119 commented 9 years ago

Hello,

Is there a method or a property or a way to disable (de-initializa) lightslider once is inisalized ? I whant to disable the slider for small resolutions (mobileview).

Thank you

rhukster commented 9 years ago

This is sort of possible but not really within lightslider itself because you are asking for a very specific feature. You could write a very simple plugin that uses the Browser object to detect a mobile platform and then disable lightslider in the Grav config.

However, what your asking for specifically is based on resolution. That is a browser thing, that is something you can only detect via javascript, and by that time, it's too late to disable the plugin.

rhukster commented 9 years ago

On further consideration, your best bet it simply to hide the slider with CSS on very small resolutions. You can't get around the loading of the JS/CSS, but it's not much overhead.