name: Smooth Scrolling
description: Configure Smooth Scrolling of links
type: atom
form:
fields:
enabled:
type: input.checkbox
label: Enabled
description: Globally enable Smooth Scrolling atom.
default: true
duration:
type: input.text
description: Enter the duration (time in milliseconds).
label: Duration (ms)
default: 900
easing:
type: select.selectize
description: Choose the easing type
label: Easing
default: swing
placeholder: 'Select...'
options:
swing: swing
linear: linear
{% extends '@nucleus/partials/particle.html.twig' %}
{% block javascript %}
<script>
jQuery(document).ready(function(){
jQuery('a[href^="#"]').on('click',function (e) {
e.preventDefault();
var target = this.hash;
var ID = jQuery(this).attr("id") ;
if (ID != "g-totop") {
if (!target) {target=".site";}
var $target = jQuery(target);
jQuery('html, body').stop().animate({
'scrollTop': $target.offset().top
}, {{ particle.duration }}, '{{ particle.easing }}', function () {if (target!=".site") {window.location.hash = target;}
});}
});
});
</script>
{% endblock %}
jQuery('a[href^="#"]:not(a[href^="#module-owlcarousel-"])').on('click',function (e) {
The following users have thanked you: Seniha Meliha, Brock Stevenson, Henning, steve123, theITfactor, JMDonald, Cyskye, Kosnichev Pavel, David C Hammond, Andrey
Time to create page: 0.067 seconds