22.03.2020, 16:40
(22.03.2020, 14:34)admin Wrote: You can use this example. Set Additional classes to widget-open for the element that opens the widget. #widget-2 is widget element id, change it and group address as needed.
Keep in mind that it won't work when transition animation is enabled.
Code:12345678$(function() { $('.widget-open').on('vclick', function() { var el = $('#widget-2'); if (el.is(':visible')) { grp.write('1/1/1', 123); } }); });
There will be widget show/hide events added in RC2 firmware that will work correctly with animation:
Code:123456789$(function() { $('#widget-2').on('widget-show', function() { grp.write('1/1/1', true); }); $('#widget-2').on('widget-hide', function() { grp.write('1/1/1', false); }); });
Ok thanks but... how I can get the actual WIDGET ELEMENT ID?