Skip Navigation

[Resolved] Scroll to map (on bottom) when click "Focus Map Marker"

This support ticket is created 3 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by stuartF-2 3 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#2497081

Hello, we need our page to scroll to the map (located at the bottom of the page) when we click on the marker focus link ("View on Map"). IMPORTANT: We only need this script to be applied when viewing our Mobile Breakpoint which is set to 830px and below - because that's when our map becomes stacked. On desktop the items are side-by-side and this would not be needed there.
hidden link

I found this previous support thread which is close: https://toolset.com/forums/topic/split-scroll-to-map-when-focus-on-map-marker-link-is-clicked/.

I tried to implement the code provided in the above thread, by replacing "top" with "bottom". But the script did not work at all. I added the script under VIEW > CUSTOM JS & CSS. If that is not the correct place to implement the code please let me know.

Thanks.

#2497235

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share problem URL and admin access details and let me review how exactly you setup the script shared with the reference ticket you shared.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2498157

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please check now.

I've adjusted the JS code you added to custom JS section of your view as given under:

jQuery( document ).on( 'js_event_wpv_pagination_completed js_event_wpv_parametric_search_results_updated js_event_wpv_addon_maps_reload_map_completed ready', function( event, data ) {
    jQuery("a.js-wpv-addon-maps-focus-map").click(function() {
        jQuery('html, body').animate({
            scrollTop: jQuery("#js-wpv-addon-maps-render-map-1").offset().top
        }, 2000);
    });
});

Can you please confirm now its working.

#2498403

Minesh, thank you for your help. It works perfectly!

My issue is resolved now.