Bootstrap-Switch options don't take effect
Asked Answered
P

1

7

I'm using Bootstrap-Switch and the documentation says that options can be passed as an object on initialization. enter link description here

And here is a list of options: enter link description here

So my code looks like this:

var options = {
    onText: "Yes",
    onColor: 'primary',
    offColor: 'danger',
    offText: "No",
    animate: true,
};

$("[name='radioGroup1']").bootstrapSwitch(options);

And it all switch works fine, but none of the defaults are overwritten by the options.

Anybody got any examples of how this might work?

Propeller answered 3/6, 2014 at 21:1 Comment(1)
The image link is not valid anymore.Homomorphism
P
5

Problem was I hadn't checked which version of Bootstrap-Switch I was using. Above code works fine in Version 3

Propeller answered 3/6, 2014 at 21:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.