I have found that to enable and disable buttons in JqueryMobile I have had to do the following:
$("#enable-livetv").addClass("livetvclick ui-btn ui-btn-inline ui-btn-corner-all ui-shadow ui-btn-up-b");
$("#disable-livetv").addClass("livetvclick ui-btn ui-btn-inline ui-btn-corner-all ui-shadow ui-btn-up-c");
In Css is there a way to group up the classes that I can reuse them rather than having to paste that code all over the place?
So I am looking for :
$("#enable-livetv").addClass("enablebuttonstyle");
$("#disable-livetv").addClass("disablebuttonstyle");
Doesn’t this work?
[EDIT]
As per the OP’s question, here’s how to reuse the defined vars across many files.
First, create a file, let’s say,
defines.js, in/jsfolder (can be anything, really, this is just an example).Then, each time the defines are needed, it’s enough to include the JS file in the
<head>tag like so:The variables should be reuseable now.