mdbootstrap / bootstrap-toggle-buttons

Bootstrap-toggle-buttons has moved to https://github.com/nostalgiaz/bootstrap-switch
https://github.com/nostalgiaz/bootstrap-switch
Apache License 2.0
1.02k stars 92 forks source link

How to show/hide divs using your toggle buttons? #45

Closed marketbizpro closed 11 years ago

marketbizpro commented 11 years ago

I'd like to be able to use your toggle buttons to show and hide form elements (e.g. options visible or invisible based on checkbox selection).

Could you give me an example of how I could do this in the javascript?

nostalgiaz commented 11 years ago

Do you mean something like this? http://jsfiddle.net/vjjnQ/4/

marketbizpro commented 11 years ago

That looks like I can play with it and get what I need...thanks!

nostalgiaz commented 11 years ago

you're welcome :D

marketbizpro commented 11 years ago

One question...how can I make one div visible and another div invisible first...then toggle both...the visible one becomes invisible and the invisible one becomes visible...both toggling with the same checkbox?

nostalgiaz commented 11 years ago

http://jsfiddle.net/vjjnQ/7/

marketbizpro commented 11 years ago

Oh, you are a godsend! Thank you, so much! Sorry for bothering you...

nostalgiaz commented 11 years ago

Thanks :) Where are you going to use this library? :)

marketbizpro commented 11 years ago

I'm prototyping an app now...I'll be outsourcing it soon. This will be a WP plugin used to build landing pages and sales funnels.