/**
* @package tjoy Responsive HTML Template
*
* Template Scripts
* Created by Dan Fisher
Custom JS
1. Main Navigation
2. Isotope
3. Flickr
4. FitVid (responsive video)
5. Carousel
-- Misc
*/
(function($) {
"use strict";
/* ----------------------------------------------------------- */
/* 1. Navigation
/* ----------------------------------------------------------- */
$(".flexnav").flexNav({
'buttonSelector': '.navbar-toggle', // default menu button class name
'animationSpeed' : 250, // default for drop down animation speed
'hoverIntent': true, // Change to true for use with hoverIntent plugin
'hoverIntentTimeout': 100 // hoverIntent default timeout
});
// Affix (fixed navigation)
$('#navbar').affix({
offset: {
top: 0
}
});
/* ----------------------------------------------------------- */
/* 4. FitVid
/* ----------------------------------------------------------- */
$(".main-content iframe[src*='vimeo'], .main-content iframe[src*='youtube']").each(function(){
$(this).wrap("");
});
$(".screen-inner, .video").fitVids();
/* ----------------------------------------------------------- */
/* -- Misc
/* ----------------------------------------------------------- */
$('.title-bordered h2').append('').prepend('');
// Animation on scroll
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
if (isMobile == false) {
$('*[data-animation]').addClass('animated');
$('.animated').appear(function() {
var elem = $(this);
var animation = elem.data('animation');
if ( !elem.hasClass('visible') ) {
var animationDelay = elem.data('animation-delay');
if ( animationDelay ) {
setTimeout(function(){
elem.addClass( animation + " visible" );
}, animationDelay);
} else {
elem.addClass( animation + " visible" );
}
}
});
}
// Counter
$(".counter[data-to]").each(function() {
var $this = $(this);
$this.appear(function() {
$this.countTo({
onComplete: function() {
if($this.data("append")) {
$this.html($this.html() + $this.data("append"));
}
}
});
}, {accX: 0, accY: 0});
});
// Circle Counter
$(".circled-counter").each(function() {
var $this = $(this);
$this.appear(function() {
$this.circliful();
}, {accX: 0, accY: 100});
});
// Magnific Popup
$('.magnific-img').magnificPopup({
removalDelay: 300,
type:'image',
mainClass: 'mfp-fade'
});
$("iframe[src*='vimeo'], iframe[src*='youtube']").each(function(){
$(this).wrap("");
});
// Comment Form Button
$('#respond #submit').addClass('btn btn-primary');
/* ----------------------------------------------------------- */
/* Parallax Background
/* ----------------------------------------------------------- */
$.stellar({
horizontalScrolling: false
});
})(jQuery);