Skip Navigation

[Resolved] Split: Scroll to map when focus on map marker link is clicked

This support ticket is created 4 years 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 4 years ago.

Assisted by: Waqar.

Author
Posts
#1835135

I have three questions relating to this page: hidden link I'm using legacy Views to build this page.

3. One last question: I have links in my query results to the corresponding map markers above. I'm trying to figure out how to have those links jump back up to the map, so users don't have to scroll to it. Any ideas?

Thanks very much. Will be happy to provide wp-admin info if that helps.

#1835209

To make the page automatically scroll to the map, when the marker focus link is clicked, you can include some custom script in your view's "JS editor" tab in the "Search and Pagination" section:


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-2").offset().top
		}, 2000);
	});
});