- This topic has 6 replies, 3 voices, and was last updated 3 years, 11 months ago by Tom.
-
AuthorPosts
-
May 12, 2020 at 12:53 am #1280342Basello
Hello,
I am tring to hook some shortcode inside the slideout menu
shortcode from a plugin (VISITOR STATISTIC PRO how use geolocation and leaflet javascript library)If it is hooked in “before_main_content” (using Elements hook) for exemple there is no problem.
But if it is hooked in the slideout menu, something is wrong, I guess the javascript do not load.I have the same issue with some script, for exemple a geolocation script from revolvermap:
<script type=”text/javascript” src=”//rf.revolvermaps.com/0/0/8.js?i=5hkgw0s45gr&m=0&c=ff0000&cr1=ffffff&f=arial&l=33″ async=”async”></script>Is it a problem related to the theme?
Is it possible something in the slideout menu prevent javascript from loading?
Do I have to set something differently?Thank you for your help.
May 12, 2020 at 5:12 am #1280618DavidStaffCustomer SupportHi there,
what happens if you add the shortcode via the Off Canvas Widget area ?
May 12, 2020 at 5:24 am #1280632BaselloHi,
Thank you for your answer.
If I insert the shortcode via the Off Canvas Widget area it doesn’t work either.
I just add it if you want to see.May 12, 2020 at 5:31 am #1280644Baselloalso I notice that as soon as I launch the javascript console from google chrome : the shortcode suddenly loads and works …
It is like something prevent the script to load and it is unlocked with the google javascript console.
It happens the same way if the shortcode is add in the widget panel or hooked.May 12, 2020 at 3:49 pm #1281689TomLead DeveloperLead DeveloperHi there,
It sounds like the script isn’t executing while it’s in a hidden div.
I wonder if there’s a way we can kick-start once the panel opens? The devs of the script would know.
Let me know 🙂
May 21, 2020 at 5:10 am #1295192BaselloHi,
Thank you for your help.
I contacted the developers of the map plugin and did some test…
In fact the problem is probably due to a “responsive” functionality.When you open the off panel menu, the card remains gray: that’s the problem. Just shorten the browser window for it to appear. Or on a smartphone, simply tilt the smartphone vertically or horizontally for the map to appear.
In the previous post I said that as soon as the browser javascript console opens, the map appears: in fact it is just the fact that showing the console in the browser changes the size of the window and brings up the map.
So, I think I have to find a way to reload the contents of the off panel menu once opened, make sure to force the resizing process…
May 21, 2020 at 2:31 pm #1295969TomLead DeveloperLead DeveloperThat could just mean they have code to re-initialize their script if the browser resizes. If that’s the case, there should be a way to initialize it when the panel opens.
-
AuthorPosts
- You must be logged in to reply to this topic.