jQuery(document).ready(function($){
/* Tabs */
tabsInit();
/* Prety Photo */
addPrettyPhoto();
/* accordion */
accordion('.accordion-items','.accordion-item','.accordion-item-body','.accordion-item-header a');
/* One by one slider */
$('#slider_wrapper_inner').oneByOne({
className: 'oneByOne2',
easeType: 'fadeInUp',
showArrow: true,
showButton: false,
slideShow: true,
width: 1960,
height: 600
});
/* Flexslider */
$(window).load(function() {
$('.flexslider').flexslider({
touchSwipe: true,
controlNav: true,
slideshow: true,
slideshowSpeed: 7000,
animationDuration: 600,
randomize: false,
pauseOnAction: true,
pauseOnHover: false,
});
});
/* Testminal */
$(function(){
// Testimonials Setting
$('.testimonials ul').cycle({
timeout: 4000,
fx: 'fade',
pause: true,
cleartypeNoBg: true,
pauseOnPagerHover: 0
});
});
/* Scale vid */
$(".scale_vid").fitVids();
/* Supperfish */
$('ul.sf-menu').superfish(
{
delay: 200,
animation: {
opacity: "show",
height: "show"
},
speed: "fast",
autoArrows: false,
dropShadows: false
});
/* Menu */
// Create the dropdown base
$("").appendTo("nav");
// Create default option "Go to..."
$("", {
"selected": "selected",
"value" : "",
"text" : "Go to..."
}).appendTo("nav select");
// Populate dropdown with menu items
$("nav a").each(function() {
var el = $(this);
$("", {
"value" : el.attr("href"),
"text" : el.text()
}).appendTo("nav select");
});
// To make dropdown actually work
// To make more unobtrusive: http://css-tricks.com/4064-unobtrusive-page-changer/
$("nav select").change(function() {
window.location = $(this).find("option:selected").val();
});
/* port */
// Blur images on mouse over
$(".blog_image a").hover( function(){
$(this).children("img").animate({ opacity: 0.75 }, "fast");
}, function(){
$(this).children("img").animate({ opacity: 1.0 }, "slow");
});
// Clone portfolio items to get a second collection for Quicksand plugin
var $portfolioClone = $(".portfolio").clone();
// Attempt to call Quicksand on every click event handler
$(".filter a").click(function(e){
$(".filter li").removeClass("current");
// Get the class attribute value of the clicked link
var $filterClass = $(this).parent().attr("class");
if ( $filterClass == "all" ) {
var $filteredPortfolio = $portfolioClone.find("li");
} else {
var $filteredPortfolio = $portfolioClone.find("li[data-type~=" + $filterClass + "]");
}
// Call quicksand
$(".portfolio").quicksand( $filteredPortfolio, {
duration: 800,
easing: 'easeInOutQuad'
});
$(this).parent().addClass("current");
// Prevent the browser jump to the link anchor
e.preventDefault();
})
});
/* accordion */
function accordion(b,bb,bbb,a){
$(a).click(function(e){
if($(this).hasClass('active')){
$(this).removeClass('active').parents(bb).find(bbb).stop(true,true).slideUp(500,'easeOutQuad');
}
else{
$(this).parents(b).find(a+'.active').removeClass('active').parents(bb).find(bbb).stop(true,true).slideUp(500,'easeOutQuad');
$(this).addClass('active').parents(bb).find(bbb).stop(true,true).slideDown(500,'easeOutQuad');
}
return false;
});
$(b).each(function(index, element) {
ax=$(element).find(a+'.active');
//if(!ax.size()){ax=$(element).find(a).eq(0).addClass('active');}
ax.parents(bb).find(bbb).slideDown(0);
});
}
function addPrettyPhoto() {
/* PrettyPhoto init */
$("a[data-rel^='prettyPhoto']").prettyPhoto({
theme: 'pp_default',
overlay_gallery: false,
show_title: false,
social_tools: false,
hideflash: true
});
}
$(function() {
var $container = $('.one_third'),
$articles = $container.children('.f_inner'),
timeout;
$articles.on( 'mouseenter', function( event ) {
var $article = $(this);
clearTimeout( timeout );
timeout = setTimeout( function() {
if( $article.hasClass('active') ) return false;
$articles.not( $article.removeClass('blur').addClass('active') )
.removeClass('active')
.addClass('blur');
}, 65 );
});
$container.on( 'mouseleave', function( event ) {
clearTimeout( timeout );
$articles.removeClass('active blur');
});
});
/* #Site Tabs */
function tabsInit() {
/*
* Skeleton V1.1
* Copyright 2011, Dave Gamache
* www.getskeleton.com
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
* 8/17/2011
*/
/* Tabs Activiation
================================================== */
var tabs = jQuery('ul.tabs');
tabs.each(function(i) {
//Get all tabs
var tab = jQuery(this).find('> li > a');
tab.click(function(e) {
//Get Location of tab's content
var contentLocation = jQuery(this).attr('href');
//Let go if not a hashed one
if(contentLocation.charAt(0)=="#") {
e.preventDefault();
//Make Tab Active
tab.removeClass('active');
jQuery(this).addClass('active');
//Show Tab Content & add active class
jQuery(contentLocation).show().addClass('active').siblings().hide().removeClass('active');
}
});
});
}
/* Totop plugin */
/* Contact Form Validation */
if(jQuery.isFunction(jQuery.fn.validate)){
$("#contactForm").validate();
}