Disable scroll to map when link is clicked from within marker listing

New home Forums Pro Add-on General queries Disable scroll to map when link is clicked from within marker listing

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #72453
    eelves
    Participant

    I have links to other pages inside of my marker listings. When a user clicks the link the page starts to scroll up to the marker on the map before directing away to the new page. Is it possible to prevent this behavior, only when a link is clicked from within a marker listing, but keep the scroll to the map otherwise?

    #72461
    Steven
    Moderator

    Hi there,

    Thank you so much for getting in touch, we really appreciate your time.

    This should be possible with some custom script to adjust the default behaviour.

    Please navigate to the link below and copy the script found in the Gist I have created for you:
    – https://gist.github.com/StevenDeBeer/f0d7e18159eb4853fdeff67cb5200b13

    Once copied, please navigate to -> Maps -> Settings -> Advanced Settings -> Paste this script in the custom JS field and save the settings.

    Kindly confirm once complete?

    Kindest Regards,
    Steven De Beer

    #72507
    eelves
    Participant

    Steven, thanks for the reply, sorry I didn’t respond sooner. The script you provided is preventing the scroll up effect on all card clicks, what I’m hoping to accomplish is more like this:

    -if user clicks a link inside of a card, prevent scroll up to map/opening infowindow and send them through to the link directly
    -if user clicks a card but not a link inside the card, allow normal behavior and scroll up to map/open infowindow.

    I hope this clarification helps, and thanks for looking into this!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.