Toggle Slide - bind function
Hi,
I want to visualize my house (lights and raffstores) with jquery mobile to eg. switch the lights with my smartphone.
To switch on/off the lights I want to use the toggle slide. But when I use this, I have to create a change function for every slider. Is it possible, to pack the slider with a function in a some kind of object? So when I add a toggle slider the change function is already included?
my first slider:
- $(function(){
- $("#light1").bind("change",function(event,ui){
- console.log("test");
- })
- });
- <select name="light1" id="light1" data-role="slider">
- <option value="off">OFF</option>
- <option value="on">ON</option>
- </select>
Thanks!