Tagged: x
-
AuthorPosts
-
August 22, 2016 at 9:03 pm #1142469
kirk74ParticipantHi there, scroll to top anchor works perfectly, except on homepage, it is going to the slider and I need it to go the the masthead underneath slider.
I tried both of the methods suggested here, and unfortunately neither quote worked: https://community.theme.co/forums/topic/scroll-top-anchor-to-masthead-under-slider/
Of the 2 methods, the one that I still have set, is the javascript method. (not the extra .php file in the child theme folder), and if you try it out, you will notice that strangely, the first time you click the top anchor button on the homepage it works.. but then if you scroll down again and use it a second time, it goes to the very top .. it is like it is getting confused exactly where #top is, after the first click.
Thanks for your help, I have tried to nut this out on my own but it is not seeming to make sense.
August 22, 2016 at 9:58 pm #1142507
kirk74ParticipantUPDATE – I have tested further, and the anomaly of it working the first time but then not after that actually happens with either of the 2 suggested methods.
So I think that all is needed is somehow to make it clear that #top is the masthead not the slider.
Thx. Will paste login privately.
August 22, 2016 at 10:04 pm #1142516
kirk74ParticipantThis reply has been marked as private.August 23, 2016 at 5:48 am #1142876
Paul RModeratorHi Kirk,
I replaced the js code that reads
jQuery(document).ready(function($) { $('.x-scroll-top').on('click', function(e) { e.preventDefault(); $( this).unbind( "click" ); $('html, body').stop(); $('html, body').animate({ scrollTop: $('.x-slider-container.above').outerHeight() + 1 }, 850, 'easeInOutExpo'); $(window).trigger('scroll'); }); });with this
jQuery(document).ready(function($) { $('.home .x-scroll-top').off('click touchstart touchend'); $('.home .x-scroll-top').on('click', function() { $('html, body').animate({ scrollTop: $('.x-slider-container.above').outerHeight() + 1 }, 850, 'easeInOutExpo'); return false; }); });It seems to work on my end. Please check.
Thanks
August 23, 2016 at 7:57 pm #1144001
kirk74Participantyes! Perfect, thanks SO much 🙂
August 23, 2016 at 9:59 pm #1144138
Prasant RaiModeratorYou are most welcome. 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1142469 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
