I have written multiple jquery function in my footer for carousel,hiding toggle bar menu on click etcc.But instead of adding in footer i need to create one custom.js file and paste all this code and call that js file. I have tried in this way but it didn't work.
<script type="text/javascript">
$(function () {
$('.nav a').filter(function () { return this.href == location.href }).parent().addClass('active').siblings().removeClass('active')
$('.nav a').click(function () {
$(this).parent().addClass('active').siblings().removeClass('active')
})
})
(function () {
$('#carousel123').carousel({ interval: 2000 });
$('#carouselABC').carousel({ interval: 3600 });
}());
(function () {
$('.carousel-showmanymoveone .item').each(function () {
var itemToClone = $(this);
for (var i = 1; i < 4; i++) {
itemToClone = itemToClone.next();
// wrap around if at end of item collection
if (!itemToClone.length) {
itemToClone = $(this).siblings(':first');
}
// grab item, clone, add marker class, add to collection
itemToClone.children(':first-child').clone()
.addClass("cloneditem-" + (i))
.appendTo($(this));
}
});
}());
$(function () {
$('#ChangeToggle').click(function () {
$('#navbar-hamburger').toggleClass('hidden');
$('#navbar-close').toggleClass('hidden');
});
});
$(document).on('click', function () {
$('.collapse').collapse('hide');
$('#navbar-hamburger').toggleClass('show');
$('#navbar-close').toggleClass('hidden');
})
</script>