📜 ⬆️ ⬇️

Switching css (clearance) "on the fly"

It was always interesting why on many sites they love being so shallow with fonts, why it is so difficult to read texts because of a poorly chosen font, or its size.



But it is quite easy to give the visitor the opportunity to make the choice of font size, and generally change any style (color, size, position, indents, etc.), and on the “fly” without using any means on the server side.
')
Immediately I will show the result, what would be clear about what I mean.

Look at the example on demo.vamhost.ru , centered, select one of the styles (default, style1, light, helius ...) and see how the store's design changes.

In this article, there will just be an example of using the jQuery library and a third-party module for switching css on the fly.

Module author home page: kelvinluck.com/article/switch-stylesheets-with-jquery

All we need to install:

1. Download the file www.kelvinluck.com/assets/jquery/styleswitch/stylesheetToggle.js

2. Download jQuery jquery.com

3. And connect the whole thing on the example of the store VaM Shop.

4. We get a working example on demo.vamhost.ru , in the center, select one of the styles (default, style1, light, helius ...) and see how the store design changes.

Change any style instantly. If you wish, you can completely change the appearance of the store, showing only the simplest examples of repainting.

Source: https://habr.com/ru/post/107575/


All Articles