• Resolved dhrvatin

    (@dhrvatin)


    I’m using the Interactive World Maps plugin. There is a section to use custom javascript to trigger a popup builder post that was previously created when a visitor clicks on the map. I’ve looked online and in this forum but can’t seem to find any code that I can use and adjust for this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Dear @dhrvatin ,

    Thanks for the message!
    Can you, please, set on click event for the popup and then insert the given code into that section?
    Here is the code:

    var popupObj = SGPBPopup.createPopupObjById(your_second_popup_id_here);
    popupObj.prepareOpen();

    Let us know if that helped, please.

    Thread Starter dhrvatin

    (@dhrvatin)

    Hello,

    I tried putting the popup id in the js code your provided and it isn’t working. I’m getting a “real-estate:900 Uncaught ReferenceError: SGPBPopup is not defined” error in the browser console.

    I’ve reached out to the map plugin support to see if they can help.

    Dear @dhrvatin ,

    Thanks for getting back to us!
    Can you, please, put that popup on the test page and send it to us so we can check that live?
    Will be looking forward to hearing from you soon.

    Thread Starter dhrvatin

    (@dhrvatin)

    I would be more than happy to schedule a call and screenshare if you’re willing to. I hardly know js as you can tell ??

    test webpage link

    I added a test popup link above the map, a version of this popup is what we want to pop up once someone clicks on any state (region) on the map.

    Here is a link to an image of the settings of the map – map settings

    Here is a ling to an image of the js custom action details – js details

    Here is the response from the Interactive World Maps plugin support

    “Hi Drew
    Looking at this code and what you’ve done so far, I believe each of your states, in the action value field, would only have the ID of the popup, so numbers like 8599 it seems.
    Then you custom code would be:

    var popupObj = SGPBPopup.createPopupObjById(parseInt(value));
    popupObj.prepareOpen();

    Basically replacing your_second_popup_id_here from the example code with the integer provided in the action value of the clicked action.
    From the side of my plugin that would be all you need. Clicking the state will trigger that code. But if you’re getting that error, then it means the popup code is not loading. For this particular error you’ll need to ask the popup developers again. Maybe it only loads the popup code if it exists on the URL somehow or is hidden in the page?”

    Thread Starter dhrvatin

    (@dhrvatin)

    Hello Sygnoos Support,

    I was able to get this working how we wanted. Thank you very much for the quick help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Trigger popup builder using javascript’ is closed to new replies.