Home > How to... > Advanced Design > When and why use scripts instead of css?

When and why use scripts instead of css?

You can replace some of the scripts found in the Script library by css. Scripts like:

$('div.products-title').hide();

The "div.products-title" is the selector, simply what we want to change. And the ".hide()" adds a "display: none" css code to that object. So it can be easily replaced with a css rule like this:

div.products-title {
    displaynone;
}

You should replace those scripts if you find that they work slowly or not at all. Or if some other script used on your site stops working after adding those.


Translate and Localize your website with 'Localizer pluggin

Shopping Cart Software by Ashop