Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › Anchor alignment issue
New Landing › How can we help? › Themeforest Theme Support › Dante › Anchor alignment issue
- This topic has 13 replies, 2 voices, and was last updated 10 years by Mohammad – SUPPORT.
-
Posted in: Dante
-
June 25, 2014 at 3:31 am #85469
The anchors do not align properly.
We have placed a blank spacer (0 height) above each section’s parallax heading, yet when you navigate via the mani menu the heading is cut off, i.e. the anchor is too high.
Please review here: http://taffydev.com.au/clients/oamm/sport/
June 25, 2014 at 6:50 am #85491Hi,
Please go to Admin -> Theme Options -> Custom JS => Here put given below code and update options.<script> jQuery( document ).ready(function() { jQuery('ul#menu-main-menu-1 li.menu-item-1389 ul.sub-menu li a').bind('click', function(e) { var anchor = jQuery(this), url = anchor.attr('href'); scrollid = url.substring(url.indexOf('#')); spacerHeight = jQuery(scrollid).height(), headerHeight = 0; if (jQuery('.sticky-header').length > 0) { headerHeight = jQuery('.sticky-header').height(); } if (jQuery('#wpadminbar').length > 0) {headerHeight = headerHeight + 28; } jQuery('html, body').stop().animate({ scrollTop: jQuery(scrollid).offset().top + spacerHeight - headerHeight - 30 }, 1000, 'easeInOutExpo'); e.preventDefault(); }); }); </script>
Hope that should work and let me know your feedback.
Thanks ๐
With Best Regards
Swift IdeasJune 25, 2014 at 7:14 am #85497Thank Mo, but it didn’t work.
I added the JS as suggest and nothing seems to have changed.
try selecting a Sport submenu from the main nav and you’ll see that the fancy header is still cut off.
June 25, 2014 at 7:31 am #85503Hi,
Please remove that one code and use this one new code:<script> jQuery( document ).ready(function() { scrollid = window.location.hash; spacerHeight = jQuery(scrollid).height(), headerHeight = 0; if (jQuery('.sticky-header').length > 0) { headerHeight = jQuery('.sticky-header').height(); } if (jQuery('#wpadminbar').length > 0) {headerHeight = headerHeight + 28; } jQuery('html, body').stop().animate({ scrollTop: jQuery(scrollid).offset().top + spacerHeight - headerHeight - 30 }, 1000, 'easeInOutExpo'); jQuery('ul#menu-main-menu-1 li.menu-item-1389 ul.sub-menu li a').bind('click', function(e) { var anchor = jQuery(this), url = anchor.attr('href'); scrollid = url.substring(url.indexOf('#')); spacerHeight = jQuery(scrollid).height(), headerHeight = 0; if (jQuery('.sticky-header').length > 0) { headerHeight = jQuery('.sticky-header').height(); } if (jQuery('#wpadminbar').length > 0) {headerHeight = headerHeight + 28; } jQuery('html, body').stop().animate({ scrollTop: jQuery(scrollid).offset().top + spacerHeight - headerHeight - 30 }, 1000, 'easeInOutExpo'); e.preventDefault(); }); }); </script>
Thanks ๐
With Best Regards
Swift IdeasJune 25, 2014 at 11:28 pm #86038This code causes many issues:
Drop-down submenus downy appear
Counters stop workingJune 26, 2014 at 2:36 am #86074Hi,
I see that you have removed the code so how can i check these issues.
ThanksJune 26, 2014 at 4:36 am #86092Hi Mo,
I have re-entered the JS for you to look at.
Problems
1) One page navigation doesn’t work
2) Sub-menus in main nav don’t work
3) Counters (Sport page) don’t workNot sure what else is wrong.
June 26, 2014 at 4:59 am #86098Hi,
Please remove that one code and use this one new code:<script> jQuery( document ).ready(function() { scrollid = window.location.hash; if(scrollid){ spacerHeight = jQuery(scrollid).height(), headerHeight = 0; if (jQuery('.sticky-header').length > 0) { headerHeight = jQuery('.sticky-header').height(); } if (jQuery('#wpadminbar').length > 0) {headerHeight = headerHeight + 28; } jQuery('html, body').stop().animate({ scrollTop: jQuery(scrollid).offset().top + spacerHeight - headerHeight - 30 }, 1000, 'easeInOutExpo'); } jQuery('ul#menu-main-menu-1 li.menu-item-1387 ul.sub-menu li a ,li.menu-item-1388 ul.sub-menu li a ,li.menu-item-1389 ul.sub-menu li a').bind('click', function(e) { var anchor = jQuery(this), url = anchor.attr('href'); scrollid = url.substring(url.indexOf('#')); spacerHeight = jQuery(scrollid).height(), headerHeight = 0; if (jQuery('.sticky-header').length > 0) { headerHeight = jQuery('.sticky-header').height(); } if (jQuery('#wpadminbar').length > 0) {headerHeight = headerHeight + 28; } jQuery('html, body').stop().animate({ scrollTop: jQuery(scrollid).offset().top + spacerHeight - headerHeight - 30 }, 1000, 'easeInOutExpo'); e.preventDefault(); }); }); </script>
Thanks ๐
With Best Regards
Swift IdeasJune 26, 2014 at 5:02 am #86101The alignment issue remains.
Click on a sub-menu in the main nag and you’ll see that it takes you to the anchor, but the parralax heading is cut off.
The blank space anchor IS above the heading.
Thanks.
June 26, 2014 at 5:10 am #86102Hi,
There is some wrong illegal character in code. Please remove that code and try again because i corrected code above.Thanks ๐
With Best Regards
Swift IdeasJune 26, 2014 at 5:20 am #86103Getting there.
This fix works on properly the Sport page, but not Retail or Digital.
Same issue.
June 26, 2014 at 5:39 am #86105Hi,
Please remove that code and try again because i corrected code above.Thanks ๐
With Best Regards
Swift IdeasJune 26, 2014 at 5:44 am #86107Perseverance has paid off โ work perfectly!
Thanks again.
June 26, 2014 at 5:54 am #86109Hi,
You most welcome. I’m very glad that issue resolved.
Thanks ๐
With Best Regards
Swift Ideas -
Posted in: Dante
You must be logged in and have valid license to reply to this topic.