//Dan Frank custom.js
jQuery(document).ready(function ($) {
$('.front .cover-title-inner .col-xs-12').html('');
$('#home-bodycontent #horizontal-search').prepend('
');
//Add social feed scripts
if ( $('.fb-page').length ) {
$('body').append('
\
');
}
if ( $('#instafeed').length ) {
$('#instafeed').html('
');
instafeed.instamount('#instafeed');
}
if ( $('#twitterfeed').length ) {
$('body').append('');
}
}
});
//Add jQuery Count Up
var a = 0;
jQuery(window).scroll(function($) {
var cBox = jQuery('.counter-box');
if (cBox.length) {
var oTop = jQuery('.counter-box').offset().top - window.innerHeight;
if (a == 0 && jQuery(window).scrollTop() > oTop) {
jQuery('.count-up').each(function() {
var $this = jQuery(this),
countTo = $this.attr('data-count');
$this.text('0');
jQuery({
countNum: $this.text()
}).animate({
countNum: countTo
},
{
duration: 3000,
easing: 'swing',
step: function() {
$this.text(Math.floor(this.countNum));
},
complete: function() {
$this.text(this.countNum);
}
});
});
jQuery('.count-down').each(function() {
var $this = jQuery(this),
countTo = $this.attr('data-count');
$this.text('100');
jQuery({
countNum: $this.text()
}).animate({
countNum: countTo
},
{
duration: 3000,
easing: 'swing',
step: function() {
$this.text(Math.floor(this.countNum));
},
complete: function() {
$this.text(this.countNum);
}
});
});
a = 1;
}
}
});