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 a widget from another widget
#2
Button that opens main widget must have static-widget Additional class. In Custom JS change number in widget ID (widget-23) to your widget ID (you can view this in browser dev tools (F12)). Your widget must used fixed position that can be set in widget settings. Main widget can only be closed by clicking on the button that opens it or by changing plans. Other widgets are closed by clicking outside of widget area.

Custom CSS:
Code:
.force-show {
  display: block !important;
}

Custom JS:
Code:
$(function() {
  var widget = $('#widget-23').removeClass('layer').css('position', 'absolute');
  
  $(document.body).on('showplan', function() {
    widget.removeClass('force-show');
  });
  
  $('.static-widget').on('vclick', function() {
    widget.toggleClass('force-show', !widget.hasClass('hide'));
  });
});
Reply


Messages In This Thread
RE: Open a widget from another widget - by admin - 27.11.2019, 09:27

Forum Jump: