$(function(){
// Top search box function
$('.top-search-box i').click(function(){
if(!$('.top-search-box form#searchform').hasClass('animated slideInUp')){
$('.top-search-box form#searchform').css('display','block').addClass('animated slideInUp');
}else{
$('.top-search-box form#searchform').removeClass('animated slideInUp').css('display','none');
}
});
// Gallery carousel
$(".gallery").owlCarousel({
singleItem:true,
navigation : true, // Show next and prev buttons
items : 1,
navigationText: ["", ""],
// "singleItem:true" is a shortcut for:
// items : 1,
// itemsDesktop : false,
// itemsDesktopSmall : false,
// itemsTablet: false,
// itemsMobile : false
});
// Related posts carousel
$(".related-posts .posts").owlCarousel({
navigation : true, // Show next and prev buttons
items : 4,
navigationText: ["", ""],
pagination: false,
autoPlay:true,
loop:true,
// "singleItem:true" is a shortcut for:
// items : 1,
// itemsDesktop : false,
// itemsDesktopSmall : false,
// itemsTablet: false,
// itemsMobile : false
});
// Adding responsive class to images
$('.post-gallery .owl-item img').addClass('img-responsive');
$('.about-author img').addClass('img-responsive');
$('.related-posts .post img').addClass('img-responsive');
$('.staff .img-container img').addClass('img-responsive');
$('.h-blog .img-container img').addClass('img-responsive');
$('#commentform').removeAttr('novalidate');
// Preloader
$("#preloader").delay(2000).fadeOut("slow");
});
$(document).mouseup(function(e)
{
var container = $(".top-search-box form#searchform");
// if the target of the click isn't the container nor a descendant of the container
if (!container.is(e.target) && container.has(e.target).length === 0)
{
container.hide();
}
});
$('.h-blog .embed-container > :not(iframe)').hide();
$('iframe').appendTo('.h-blog .embed-container');
$('.h-blog .gallery-container > :not(.gallery)').hide();
$('.gallery').appendTo('.h-blog .gallery-container');