• Resolved amarantine

    (@amarantine)


    Hi

    Using your help article about custom JS, I try add only this:

    document.querySelector(‘#open-add-location-overlay’).click();

    However, it does not work.

    I am using free version. Updated plugin. Updated WP. No other plugins. Theme standard “Twenty Twenty-Four”.

    I even tried oumMap.flyTo([40.737, -73.923], 8); from help article. This works.

    Do you have any ideas why the overlay won’t open?

    I am looking to buy this plugin. Great work. Just need this to work first.

    Best regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author 100plugins

    (@100plugins)

    Hi @amarantine,

    As long as you are seeing a “+” button in the top right of your map, that is clickable – this script should work:

    document.querySelector('#open-add-location-overlay').click();

    Pay attention to the type of single quotes. Alternatively you can also use double quotes.

    Does this help?

    Best regards,
    Daniel

    • This reply was modified 10 months, 4 weeks ago by 100plugins.
    Thread Starter amarantine

    (@amarantine)

    Thanks for the reply.

    It still doesn’t work. I tried with a new simple theme as well. Fresh install of the plugin. I do see the + button. Only copy-pasted your JS snippet and made no other settings. Tried both Chrome and Edge. I am running locally, so I can’t show you right now.

    Do you succeed in using the JS snippet on your end? Any other ideas? Troubleshooting I could do?

    Best regards

    Plugin Author 100plugins

    (@100plugins)

    Hi @amarantine ,

    I’ve found the problem and updated the script on the website. You need to make sure to call the click function after all page elements have loaded:

    jQuery(document).ready(function() {
      document.querySelector('#open-add-location-overlay').click();
    });

    Tested and worked.

    Best regards,
    Daniel

    • This reply was modified 10 months, 2 weeks ago by 100plugins. Reason: wording
    Thread Starter amarantine

    (@amarantine)

    Great. Can confirm this works. You got yourself a subscriber as soon as I’m ready to launch my site.

    Thanks
    Amarantine

    Plugin Author 100plugins

    (@100plugins)

    Thanks @amarantine! Feel free to leave a review here if you are happy with my plugin.

    Best regards,
    Daniel

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Open the “Add location” form javascript not working’ is closed to new replies.