Reply To: Joomla Template Interior OnePage Smooth Scroll Links in content possible?

Home Forums Support Joomla Template Interior OnePage Smooth Scroll Links in content possible? Reply To: Joomla Template Interior OnePage Smooth Scroll Links in content possible?


Hi Heinz,
Just add custom js code via template settings

<!-- SMOOTH SCROLL -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(function() {
  $('a[href*=#]:not([href=#])').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
      var target = $(this.hash);
      target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
      if (target.length) {
        $('html,body').animate({
          scrollTop: target.offset().top
        }, 1000);
        return false;
      }
    }
  });
});
</script>
<!-- End of SMOOTH SCROLL -->

then give a try with smooth scroll again for the custom link