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.

Auto-opening widget after loading the page
#1
Hi I'm constantly trying to find a solution; automatic loading of the widget after loading the page. I found js code on the forum that uses the page id (currentPlanId) and the widget id. Unfortunately it doesn't work properly on my page:

https://forum.logicmachine.net/showthrea...idget+open

Maybe someone knows how to write code that automatically opens the widget after the page is loaded?

Attached Files Thumbnail(s)
   
Reply
#2
You should not be using widget for this only two plans and the floor plan directly on it. If you use Pietro and Parter as links with icon and active icon you will get exactly what you need.
------------------------------
Ctrl+F5
Reply
#3
Add this to Custom JavaScript. Add widget-autoopen class to the button that will be clicked when the plan is shown.
Code:
$(function(){
  function showWidgets() {
    $('#plan-' + currentPlanId).find('.widget-autoopen').trigger('vclick');
  }
  
  $('body').on('showplan', showWidgets);
  showWidgets();
});
Reply
#4
(03.09.2021, 07:41)Daniel Wrote: You should not be using widget for this only two plans and the floor plan directly on it. If you use Pietro and Parter as links with icon and active icon you will get exactly what you need.

Yes, you are right, Thanks!

(03.09.2021, 07:47)admin Wrote: Add this to Custom JavaScript. Add widget-autoopen class to the button that will be clicked when the plan is shown.
Code:
$(function(){
  function showWidgets() {
    $('#plan-' + currentPlanId).find('.widget-autoopen').trigger('vclick');
  }
 
  $('body').on('showplan', showWidgets);
  showWidgets();
});

Works fantastic, thank you very much!
Reply


Forum Jump: