Layui Switch Switch Monitor Summary Popup Determined Current Example

Unused, direct picture:

layui switch 开关监听 弹出确定状态转换的例子 Click OK:

layui switch 开关监听 弹出确定状态转换的例子

Code: layui switch 开关监听 弹出确定状态转换的例子

Document
           // demo layui.use (['form', 'jQuery', 'layer'], function () {var form = layui.form; var jquery = layui.jqury; var layer = Layui.Layer; // Monitor submit form.on ('SwitchTest)', Function (data) {console.log (data.elem); // Get checkbox original DOM object console.log (data.elec.checked) ; / / Switch is turned on, true or false constole.log (data.value); / / switch value value, can also get console.log (data.iction) by Data.Elem.Value; // Get beautifying DOM Object VAR x = data.elem.checked; layer.open ({Content: 'Test', BTN: ['OK', 'Cancel'], YES: Function (Index, Layero) {data.elec.checked = x; form.Render (); layer.close (Index ); // button [button one] callback}, btn2: function (index, layero) {// button [button 2] callback Data.eM.checked =! X; form.render (); layer.close INDEX); // Return False Opens the code to disable Click this button to turn off}, ca Zan: function () {// Top Top right corner Turn the callback data.elec.checked =! x; form.render (); // Return False Open This code can disable the button to close}}}});});});  
Many this Layui Switch The switch to listen to the pop-up determined state transformation is the full content of Xiaobian sharing, I hope I can give you a reference, I hope everyone supports Tumi Cloud.
© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment