Problem: I would like to scroll to a specific place on the page when a page is loaded, but only if coming from a search form on another page. If loading the page directly, I do not want to scroll.
Solution: You can use JavaScript to test for a specific URL parameter on document ready, and then animate the scrolltop attribute.
jQuery(document).ready(function(){ if( window.location.href.indexOf('wpv_filter_submit') > -1) { jQuery('html, body').animate({ scrollTop: jQuery("#product-select").offset().top }, 'slow'); } });
Relevant Documentation:
http://api.jquery.com/
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.
Dieses Thema wurde abgetrennt von https://toolset.com/de/forums/topic/search-results-updated-scroll-to-id-or-specific-place-on-page/
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
Dieses Thema enthält 5 Antworten, hat 2 Stimmen.
Zuletzt aktualisiert von vor 6 Jahren.
Assistiert von: Christian Cox.