Skip Navigation

[Resolved] Scroll to top (map) when "focus on marker button" is clicked

This support ticket is created 4 years, 4 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 3 replies, has 2 voices.

Last updated by andrewD-10 4 years, 4 months ago.

Assisted by: Nigel.

Author
Posts
#1392913

Tell us what you are trying to do?

i want the page scroll to top on the map when focus on marker link is clicked. Here is my table view hidden link.

I tried this custom jQuery script in loop items hidden link by following the below link. it worked earlier few days back when i tried it first time but stopped working now after more work on this view. Please figure it out what can be the problem or please fix this custom jquery according to need.
https://toolset.com/forums/topic/totop-when-js-wpv-addon-maps-focus-map/

Also i need help to scroll down to table from top when filters are selected and submitted for query. hidden link.
Please help if any custom code is needed there?
Your help will be really appreciated.
Thanks
What is the link to your site?
hidden link

#1393003

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Andrew

I need to be able to access your site to see exactly what you've done already and check how that is currently working.

Let me mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site.

Which page is the search View on?

#1394079

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Andrew

There was a JS error in the console because you were using $ as the shortcut for jQuery too early.

I modified your code, wrapping it inside a dom ready event that sets up the $ shortcut for jQuery, like so:

( function( $ ) {
	$( document ).ready( function(){

    	$(".js-wpv-addon-maps-focus-map").click(function() {
    		$('html, body').animate({
        		scrollTop: $("#js-wpv-addon-maps-render-map-3").offset().top - 70
    		}, 1000);
		});
    });
})( jQuery );

Alternatively, you could have replaced $ with jQuery throughout.

I'm not sure what you are asking, about the other thread, that ticket is still open so if you have a follow-up question please post it there, thanks.

#1394947

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.