Tagged: anchors
Hello,
My anchors are not working properly. I used a template for Consulting. On desktop, the anchors are fine, please see picture 1 and 2 below…when I click on “services” on the side bar, it goes to the correct section. But on mobile, the anchors do not work correctly. When I do the same and click on “services”, it goes down too low, please see pictures 3-5.
You can see that picture 2 is the correct position on desktop, while picture 5 is too low on mobile. Please help.
Hey Wisith,
Could you post a link to the site in question so that we can take a closer look please?
Best regards,
Rikard
Hello,
Sure. Website is http://www.sunsurn.com
Please let me know. As mentioned, the anchors work fine on desktop, but not on mobile.
Thanks
Hi,
I get the same results on iphone6/chrome though I’m not sure why that is happening, could you post admin login in private so that we can have a closer look please?
Best regards,
Rikard
Hello,
Please see below for my log in information.
Thank you
Hello,
I want to follow up. It is still not fixed, I checked the website with my iPhone just now.
Thank you
Hi,
For testing purpose please deactivate all plugins and add the below code at the bottom of the functions.php
// Scroll to div
function scrollToDiv(){
?>
<script>
jQuery(document).scroll(function() {
var sections = jQuery('.avia-section'),
menu = jQuery('#mobile-advanced li a');
menu.on('click', function(event) {
var target = jQuery(this.getAttribute('href'));
if( target.length ) {
event.preventDefault();
jQuery('html, body').stop().animate({
scrollTop: target.offset().top - 1000
}, 1000);
}
});
});
</script>
<?php
}
add_action('wp_head', 'scrollToDiv');
Best regards,
Vinay