Lorem ipsum

HF Scripty

<script>
$('.sidenav-toggle').on('click', function() {
var $sidenav, $this;
$this = $(this);
$sidenav = $('.ct-sidenav');
if ($this.hasClass('active')) {
$this.removeClass('active');
return $sidenav.removeClass('active');
} else {
$this.addClass('active');
return $sidenav.addClass('active');
}
});
$('#sidenav-toggle').on('click', function() {
var $sidenav, $this;
$this = $(this);
$sidenav = $('.ct-sidenav');
if ($this.hasClass('open')) {
$this.removeClass('open');
return $sidenav.removeClass('open');
} else {
$this.addClass('open');
return $sidenav.addClass('open');
}
});
$('.ct-sidenav').find('button.close').on('click', function() {
$(this).parent().removeClass('open');
return $('#sidenav-toggle').removeClass('open');
});
</script>

 

<script>
// Sticky Header
$(window).scroll(function() {

if ($(window).scrollTop() > 100) {
$('.main_h').addClass('sticky');
} else {
$('.main_h').removeClass('sticky');
}
});

// Mobile Navigation
$('.mobile-toggle').click(function() {
if ($('.main_h').hasClass('open-nav')) {
$('.main_h').removeClass('open-nav');
} else {
$('.main_h').addClass('open-nav');
}
});

$('.main_h li a').click(function() {
if ($('.main_h').hasClass('open-nav')) {
$('.navigation').removeClass('open-nav');
$('.main_h').removeClass('open-nav');
}
});

// navigation scroll lijepo radi materem
$('nav a').click(function(event) {
var id = $(this).attr("href");
var offset = 70;
var target = $(id).offset().top - offset;
$('html, body').animate({
scrollTop: target
}, 500);
event.preventDefault();
});
</script>

<script>
var accordion = (function(){

var $accordion = $('.js-accordion');
var $accordion_header = $accordion.find('.js-accordion-header');
var $accordion_item = $('.js-accordion-item');

// default settings
var settings = {
// animation speed
speed: 400,

// close all other accordion items if true
oneOpen: false
};

return {
// pass configurable object literal
init: function($settings) {
$accordion_header.on('click', function() {
accordion.toggle($(this));
});

$.extend(settings, $settings);

// ensure only one accordion is active if oneOpen is true
if(settings.oneOpen && $('.js-accordion-item.active').length > 1) {
$('.js-accordion-item.active:not(:first)').removeClass('active');
}

// reveal the active accordion bodies
$('.js-accordion-item.active').find('> .js-accordion-body').show();
},
toggle: function($this) {

if(settings.oneOpen && $this[0] != $this.closest('.js-accordion').find('> .js-accordion-item.active > .js-accordion-header')[0]) {
$this.closest('.js-accordion')
.find('> .js-accordion-item')
.removeClass('active')
.find('.js-accordion-body')
.slideUp()
}

// show/hide the clicked accordion item
$this.closest('.js-accordion-item').toggleClass('active');
$this.next().stop().slideToggle(settings.speed);
}
}
})();

$(document).ready(function(){
accordion.init({ speed: 300, oneOpen: true });
});
</script>

 

<script type="text/javascript">
$('a[href="/"]').prop('href', '/all/');
</script>