This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Open/Close Widget
#4
Use an object that is not connected to any control so the its value is always 0. Change widget-5 to your widget element ID, additional class for the opening element is widget-opener, change icon paths as needed.
Code:
$(function(){
  var widget = $('#widget-5');
  var img = $('.widget-opener').find('img');
  var icon_on = '/scada/resources/icons/ok-active.svg';
  var icon_off = '/scada/resources/icons/ok.svg';
  
  widget
    .on('widget-show', function() { img.attr('src', icon_on); })
    .on('widget-hide', function() { img.attr('src', icon_off); });
});
Reply


Messages In This Thread
Open/Close Widget - by JoseJimenez94 - 25.01.2021, 15:47
RE: Open/Close Widget - by admin - 01.02.2021, 07:49
RE: Open/Close Widget - by JoseJimenez94 - 11.02.2021, 10:44
RE: Open/Close Widget - by admin - 15.02.2021, 11:38

Forum Jump: