| Current Path : /var/www/templates/jl_appnow_free/particles/ |
| Current File : /var/www/templates/jl_appnow_free/particles/onepage.html.twig |
{% extends '@nucleus/partials/particle.html.twig' %}
{% block particle %}{% endblock %}
{% block javascript_footer %}
{% do
gantry.load('jquery') %}
<script src="{{ url('gantry-theme://js/jquery.nav.js') }}"></script>
<script>
jQuery(function($) {
{% set juri = joomla.instance("JURI") %}
{% set base = juri.base %}
var onePageUrl = '{{base}}';
{% set arr = particle.exception|split(",") %}
var menus = [];
var filter = '';
{% for item in arr %}
menus.push("{{item|trim()}}".toLowerCase());
{% endfor %}
$('.g-main-nav ul li').each(function(){
var name = $(this).find(".g-menu-item-title").eq(0).text().trim().toLowerCase();
if ($.inArray(name, menus) != -1){
$(this).addClass('no-scroll');
}
});
var homeSectionId = $('#g-page-surround > section:first-child').attr('id');
$('.g-main-nav ul').find('li:not(".no-scroll")').each(function(i, el) {
var $that = $(this),
$anchor = $that.children('a'),
url = $anchor.attr('href');
if (typeof url !== "undefined"){
splitUrl = url.split('#');
if ($that.hasClass('home')) {
if (homeSectionId) {
$anchor.attr('href', onePageUrl + '#' + homeSectionId);
} else {
$anchor.attr('href', onePageUrl);
}
} else {
if (typeof splitUrl !== undefined) {
$anchor.attr('href', onePageUrl + '#' + splitUrl[1]);
};
}
}
});
$('.g-parent .no-scroll').removeClass('active');
$('.g-toplevel').onePageNav({
currentClass: '{{particle.clsactive}}',
changeHash: {{particle.changeHash ? "true" : "false"}},
scrollSpeed: {{particle.scrollSpeed == "" ? 750 : particle.scrollSpeed}},
scrollOffset: {{particle.offset == "" ? 30 : particle.offset}},
scrollThreshold: {{particle.scrollThreshold == "" ? "0.5" : particle.scrollThreshold}},
filter: ':not(.no-scroll)'
});
});
</script>
{% endblock %}