Automatisches Scrollen zum Produkt-Top im Weiterleitungsmodus
In Datei footer.php Ihres aktuellen WordPress-Themes (Child-Theme verwenden) fügen Sie den folgenden Code hinzu:
<?php if (isset($_GET['swoof'])): ?>
<script>
jQuery(function ($) {
setTimeout(function () {
$('html, body').animate({
scrollTop: $(".woof_products_top_panel_content").offset().top - 100
}, 777);
}, 333);
});
</script>
<?php endif; ?>
.woof_products_top_panel_content – ist eine CSS-Klasse des Containers, in dem das Scrollen beendet wird. Sie können jeden Container mit jeder CSS-Klasse oder ID verwenden…