jQuery(window).load(function($){
/*===========================================================*/
/* Revolution Slider
/*===========================================================*/
var tpj=jQuery;
tpj.noConflict();
tpj(document).ready(function() {
if (tpj.fn.cssOriginal!=undefined)
tpj.fn.css = tpj.fn.cssOriginal;
tpj('.fullwidthbanner').revolution(
{
delay:6000,
startwidth:1024,
startheight:425,
onHoverStop:"off", // Stop Banner Timet at Hover on Slide on/off
thumbWidth:100, // Thumb With and Height and Amount (only if navigation Tyope set to thumb !)
thumbHeight:50,
thumbAmount:3,
hideThumbs:200,
navigationType:"none", // bullet, thumb, none
navigationArrows:"verticalcentered", // nexttobullets, solo (old name verticalcentered), none
navigationStyle:"square", // round,square,navbar,round-old,square-old,navbar-old, or any from the list in the docu (choose between 50+ different item), custom
navigationHAlign:"center", // Vertical Align top,center,bottom
navigationVAlign:"bottom", // Horizontal Align left,center,right
navigationHOffset:0,
navigationVOffset:0,
soloArrowLeftHalign:"left",
soloArrowLeftValign:"center",
soloArrowLeftHOffset:0,
soloArrowLeftVOffset:0,
soloArrowRightHalign:"right",
soloArrowRightValign:"center",
soloArrowRightHOffset:0,
soloArrowRightVOffset:0,
touchenabled:"on", // Enable Swipe Function : on/off
stopAtSlide:-1, // Stop Timer if Slide "x" has been Reached. If stopAfterLoops set to 0, then it stops already in the first Loop at slide X which defined. -1 means do not stop at any slide. stopAfterLoops has no sinn in this case.
stopAfterLoops:1, // Stop Timer if All slides has been played "x" times. IT will stop at THe slide which is defined via stopAtSlide:x, if set to -1 slide never stop automatic
fullWidth:"on",
shadow:0 //0 = no Shadow, 1,2,3 = 3 Different Art of Shadows - (No Shadow in Fullwidth Version !)
});
});
});
/*-----------------------------------------------------------------------------------
/* Custom Scripts
-----------------------------------------------------------------------------------*/
(function($){
$(document).ready(function(){
/*----------------------------------------------------*/
/* Carousel
/*----------------------------------------------------*/
// Add classes for other carousels
var $carousel = $('.our_client');
var $carousel = $('.recent-work-jc');
var scrollCount;
function adjustScrollCount() {
if( $(window).width() < 768 ) {
scrollCount = 1;
} else {
scrollCount = 2;
}
}
function adjustCarouselHeight() {
$carousel.each(function() {
var $this = $(this);
var maxHeight = -1;
$this.find('li').each(function() {
maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height();
});
$this.height(maxHeight);
});
}
function initCarousel() {
adjustCarouselHeight();
adjustScrollCount();
var i = 0;
var g = {};
$carousel.each(function() {
i++;
var $this = $(this);
g[i] = $this.jcarousel({
animation : 600,
scroll : scrollCount
});
$this.jcarousel('scroll', 0);
$this.prev().find('.jcarousel-prev').bind('active.jcarouselcontrol', function() {
$(this).addClass('active');
}).bind('inactive.jcarouselcontrol', function() {
$(this).removeClass('active');
}).jcarouselControl({
target: '-='+scrollCount,
carousel: g[i]
});
$this.prev().find('.jcarousel-next').bind('active.jcarouselcontrol', function() {
$(this).addClass('active');
}).bind('inactive.jcarouselcontrol', function() {
$(this).removeClass('active');
}).jcarouselControl({
target: '+='+scrollCount,
carousel: g[i]
});
$this.touchwipe({
wipeLeft: function() {
$this.jcarousel('scroll','+='+scrollCount);
},
wipeRight: function() {
$this.jcarousel('scroll','-='+scrollCount);
}
});
});
}
$(window).load(function(){
initCarousel();
});
$(window).resize(function () {
$carousel.each(function() {
var $this = $(this);
$this.jcarousel('destroy');
});
initCarousel();
});
jQuery(document).ready(function($) {
/*===========================================================*/
/* Sticky Nav
/*===========================================================*/
$(".subHead").sticky({topSpacing:0});
// Find the toggles and hide their content
$('.toggle').each(function(){
$(this).find('.toggle-content').hide();
});
// When a toggle is clicked (activated) show their content
$('.toggle a.toggle-trigger').click(function(){
var el = $(this), parent = el.closest('.toggle');
if( el.hasClass('active') )
{
parent.find('.toggle-content').slideToggle();
el.removeClass('active');
}
else
{
parent.find('.toggle-content').slideToggle();
el.addClass('active');
}
return false;
});
// Tabs
$(".nav-tabs a").on('click', function (e) {
e.preventDefault();
$(this).tab("show");
})
}); //End
/*----------------------------------------------------*/
/* Notification Boxes
/*----------------------------------------------------*/
$(document).ready(function(){
$('.close').click(function(){
$(this).parent().fadeOut('slow');
});
});
/*----------------------------------------------------*/
/* Tabs
/*----------------------------------------------------*/
$(document).ready(function(){
$("#tabs li").click(function() {
var this_tmp = $(this);
$("#tabs li").removeClass('active');
$(this).addClass("active");
$(".tab_content:visible").fadeOut(300, function(){
var selected_tab = this_tmp.find("a").attr("href");
$(selected_tab).fadeIn(300);
});
return false;
});
/*----------------------------------------------------*/
/* Hover Overlay
/*----------------------------------------------------*/
$(".mediatouchinger").hover(function () {
$(this).find(".hovercover").stop().fadeTo(100, 1);
$(this).find(".hovericon").stop().animate({'top' : '50%', 'opacity' : 1}, 250, 'easeOutBack');
},function () {
$(this).find(".hovercover").stop().fadeTo(200, 0);
$(this).find(".hovericon").stop().animate({'top' : '65%', 'opacity' : 0}, 150, 'easeOutSine');
});
});
/*----------------------------------------------------*/
/* Vertical Multi Menu
/*----------------------------------------------------*/
$(document).ready(function(){
$(function() {
var itemsList = $('.vertical-menu > li > ul'),
itemLink = $('.vertical-menu > li > a');
expandedItem = $('.vertical-menu > li > ul.expand');
itemsList.hide();
expandedItem.show();
itemLink.click(function(e) {
e.preventDefault();
if(!$(this).hasClass('active')) {
itemLink.removeClass('active');
itemsList.filter(':visible').slideUp('normal');
$(this).addClass('active').next().stop(true,true).slideDown('normal');
} else {
$(this).removeClass('active');
$(this).next().stop(true,true).slideUp('normal');
}
});
});
/*==================================================
/* Tooltip
/*================================================== */
$( 'body' ).tooltip({
selector: "a[data-toggle=tooltip]"
});
$(function() {
$('.flexslider').flexslider({
animation: "fade",
controlNav: false,
animationSpeed: 400,
smoothHeight: true,
useCSS : false
});
$('.project_detail').flexslider({
animation: "fade",
controlNav: false,
animationSpeed: 400,
smoothHeight: true,
useCSS : false
});
$('#slider_blog_1').flexslider({
animation : 'slide',
controlNav : false,
directionNav : true,
animationLoop : true,
slideshow : false,
useCSS : false
});
$('.twitter-feed').flexslider({
animation:"slide",
easing:"swing",
controlNav: false,
reverse:false,
smoothHeight:false,
directionNav: false,
slideshowSpeed: 4000
});
});
});
/*----------------------------------------------------*/
/* Accordions with contents
/*----------------------------------------------------*/
$(document).ready(function(){
jQuery(".accordion").on("show",function (e) {
jQuery(e.target).prev(".accordion-heading").find(".accordion-toggle").addClass("active");
}).on("hide",function (e) {
jQuery(this).find(".accordion-toggle").not(jQuery(e.target)).removeClass("active");
}).each(function () {
var $a = jQuery(this);
$a.find("a.accordion-toggle").attr("data-parent", "#" + $a.attr("id"));
});
});
// ==========
// = Scroll event function =
// ==========
var goScrolling = function(elem) {
var docViewTop = $(window).scrollTop();
var docViewBottom = docViewTop + $(window).height();
var elemTop = elem.offset().top;
var elemBottom = elemTop + elem.height();
return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
};
// ==========
// = Progress bars =
// ==========
$('.progress .bar').data('width', $(this).width()).css({
width : 0
});
$(window).scroll(function() {
$('.progress .bar').each(function() {
if (goScrolling($(this))) {
$(this).css({
width : $(this).attr('data-value') + '%'
});
}
});
})
$('.teamPhoto')
.on('mouseenter', function() {
$(this).children('.aboutSocial').stop().fadeIn(200);
})
.on('mouseleave', function() {
$(this).children('.aboutSocial').stop().fadeOut(200);
});
$.fn.carousel = function(op) {
var op, ui = {};
op = $.extend({
speed: 500,
autoChange: false,
interval: 5000
}, op);
ui.carousel = this;
ui.items = ui.carousel.find('.carousel-item');
ui.itemsLen = ui.items.length;
// CREATE CONTROLS
ui.ctrl = $('
', {'class': 'carousel-control'});
ui.prev = $('', {'class': 'carousel-prev'});
ui.next = $('', {'class': 'carousel-next'});
ui.pagList = $('', {'class': 'carousel-pagination'});
ui.pagItem = $('');
for (var i = 0; i < ui.itemsLen; i++) {
ui.pagItem.clone().appendTo(ui.pagList);
}
ui.prev.appendTo(ui.ctrl);
ui.next.appendTo(ui.ctrl);
ui.pagList.appendTo(ui.ctrl);
ui.ctrl.appendTo(ui.carousel);
ui.carousel.find('.carousel-pagination li').eq(0).addClass('active');
ui.carousel.find('.carousel-item').each(function() {
$(this).hide();
});
ui.carousel.find('.carousel-item').eq(0).show().addClass('active');
// CHANGE ITEM
var changeImage = function(direction, context) {
var current = ui.carousel.find('.carousel-item.active');
if (direction == 'index') {
if(current.index() === context.index())
return false;
context.addClass('active').siblings().removeClass('active');
ui.items.eq(context.index()).addClass('current').fadeIn(op.speed, function() {
current.removeClass('active').hide();
$(this).addClass('active').removeClass('current');
});
}
if (direction == 'prev') {
if (current.index() == 0) {
ui.carousel.find('.carousel-item:last').addClass('current').fadeIn(op.speed, function() {
current.removeClass('active').hide();
$(this).addClass('active').removeClass('current');
});
}
else {
current.prev().addClass('current').fadeIn(op.speed, function() {
current.removeClass('active').hide();
$(this).addClass('active').removeClass('current');
});
}
}
if (direction == undefined) {
if (current.index() == ui.itemsLen - 1) {
ui.carousel.find('.carousel-item:first').addClass('current').fadeIn(300, function() {
current.removeClass('active').hide();
$(this).addClass('active').removeClass('current');
});
}
else {
current.next().addClass('current').fadeIn(300, function() {
current.removeClass('active').hide();
$(this).addClass('active').removeClass('current');
});
}
}
ui.carousel.find('.carousel-pagination li').eq( ui.carousel.find('.carousel-item.current').index() ).addClass('active').siblings().removeClass('active');
};
ui.carousel
.on('click', 'li', function() {
changeImage('index', $(this));
})
.on('click', '.carousel-prev', function() {
changeImage('prev');
})
.on('click', '.carousel-next', function() {
changeImage();
});
// AUTO CHANGE
if (op.autoChange) {
var changeInterval = setInterval(changeImage, op.interval);
ui.carousel
.on('mouseenter', function() {
clearInterval(changeInterval);
})
.on('mouseleave', function() {
changeInterval = setInterval(changeImage, op.interval);
});
}
return this;
};
$('.aboutCarousel').each(function() {
$(this).carousel({
autoChange: true
});
});
$('.porDetCarousel').each(function() {
$(this).carousel({
autoChange: true
});
});
$('.porDet2Carousel').each(function() {
$(this).carousel({
autoChange: true
});
});
//if(jQuery('ul').hasClass('tweet_feed')){
//jQuery('.tweet_feed').bxSlider({
//mode: 'vertical',
//pager: false,
//auto: true,
//controls: true,
//pause: 3000,
//speed: 800,
//nextText: '',
//prevText: '',
//nextSelector: '#tw-next',
//prevSelector: '#tw-prev',
//useCSS: false,
//infiniteLoop:true,
//easing: 'easeInOutExpo',
//stopAuto: false,
//autoHover: false
//});
//}
if(jQuery('ul').hasClass('jcarousel-skin-tango')){
jQuery('.jcarousel-skin-tango').bxSlider({
mode: 'horizontal',
pager: false,
auto: true,
controls: false,
pause: 3000,
speed: 500,
nextText: '',
prevText: '',
nextSelector: '#test-next',
prevSelector: '#test-prev',
useCSS: false,
specialEasing: {
width: "swing",
height: "easeOutBounce"
},
stopAuto: false,
autoHover: true
});
}
// BUTTON UP
var btnUp = $('', {'class':'btntoTop'});
btnUp.appendTo('body');
$(document)
.on('click', '.btntoTop', function() {
$('html, body').animate({
scrollTop: 0
}, 700);
});
$(window)
.on('scroll', function() {
if ($(this).scrollTop() > 200)
$('.btntoTop').addClass('active');
else
$('.btntoTop').removeClass('active');
});
/* Accordion
/* ---------------------------------------------------------------------- */
(function() {
var $container = $('.acc-container'),
$trigger = $('.acc-trigger');
$container.hide();
$trigger.first().addClass('active').next().show();
var fullWidth = $container.outerWidth(true);
$trigger.css('width', fullWidth);
$container.css('width', fullWidth);
$trigger.on('click', function(e) {
if( $(this).next().is(':hidden') ) {
$trigger.removeClass('active').next().slideUp(300);
$(this).toggleClass('active').next().slideDown(300);
}
e.preventDefault();
});
// Resize
$(window).on('resize', function() {
fullWidth = $container.outerWidth(true)
$trigger.css('width', $trigger.parent().width() );
$container.css('width', $container.parent().width() );
});
})();
/*===========================================================*/
/* Isotope Posrtfolio
/*===========================================================*/
if(jQuery.isFunction(jQuery.fn.isotope)){
jQuery('.portfolio_list').isotope({
itemSelector : '.list_item',
layoutMode : 'fitRows',
animationEngine : 'jquery'
});
/* ---- Filtering ----- */
jQuery('#filter li').click(function(){
var $this = jQuery(this);
if ( $this.hasClass('selected') ) {
return false;
} else {
jQuery('#filter .selected').removeClass('selected');
var selector = $this.attr('data-filter');
$this.parent().next().isotope({ filter: selector });
$this.addClass('selected');
return false;
}
});
}
/*----------------------------------------------------*/
/* Swipe Slider
/*----------------------------------------------------*/
window.mySwipe = new Swipe(document.getElementById('slider'), {
startSlide: 1,
speed: 400,
auto: 3000,
continuous: true,
disableScroll: false,
stopPropagation: false,
callback: function(index, elem) {},
transitionEnd: function(index, elem) {}
});
window.mySwipe2 = new Swipe(document.getElementById('p_slider'), {
startSlide: 1,
speed: 400,
auto: 3000,
continuous: true,
disableScroll: false,
stopPropagation: false,
callback: function(index, elem) {},
transitionEnd: function(index, elem) {}
});
/*----------------------------------------------------*/
/* Magnific Popup
/*----------------------------------------------------*/
$(document).ready(function(){
$('body').magnificPopup({
type: 'image',
delegate: 'a.mfp-gallery',
fixedContentPos: true,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: true,
removalDelay: 0,
mainClass: 'mfp-fade',
gallery:{enabled:true},
callbacks: {
buildControls: function() {
console.log('inside'); this.contentContainer.append(this.arrowLeft.add(this.arrowRight));
}
}
});
$('.mfp-image').magnificPopup({
type: 'image',
closeOnContentClick: true,
mainClass: 'mfp-fade',
image: {
verticalFit: true
}
});
$('.mfp-youtube, .mfp-vimeo, .mfp-gmaps').magnificPopup({
disableOn: 700,
type: 'iframe',
mainClass: 'mfp-fade',
removalDelay: 0,
preloader: false,
fixedContentPos: false
});
});
// MENU
if ($(this).width() > 990) {
$('.main').addClass('desk');
}
$('.menu_button').on('click', function() {
$(this).toggleClass('active');
$('.mobile_menu').slideToggle(300);
});
$('.sub_menu_button').on('click', function() {
var sub = $(this).parent().siblings('.sub_menu, .mobile_sub_menu');
$(this).toggleClass('active');
sub.slideToggle(300);
});
$('.menu > li').each(function() {
var sub = $(this).children('.sub_menu').size();
if (sub > 0) $(this).addClass('have_sub');
});
$(window).resize(function() {
if ($('.menu_button').css('display') === 'block') {
$('.main').removeClass('desk');
}
else {
$('.main').addClass('desk');
$('.menu, .sub_menu, .b-search').removeAttr('style');
}
});
// FORMS: COMMENT
$('.comment-submit').on('click', function() {
$(this).parent().submit();
});
/*===========================================================*/
/* Contact Form
/*===========================================================*/
$('#contact-form').validate({
rules: {
username: {
minlength: 6,
required: true
},
email: {
required: true,
email: true
},
url: {
minlength: 12,
required: true
},
message: {
minlength: 10,
required: true
}
},
highlight: function(element) {
$(element).closest('.control-group').removeClass('success').addClass('error');
},
success: function(element) {
element
.text('OK!').addClass('valid')
.closest('.control-group').removeClass('error').addClass('success');
}
});
/*===========================================================*/
/* Twitter Feed
/*===========================================================*/
$(".twitter-feed").tweet({
join_text: "auto",
username: ["envato"],
modpath: "inc/twitter/",
count: 10,
loading_text: "loading ..."
});
/*===========================================================*/
/* Preloader
/*===========================================================*/
//
/* ------------------ End Document ------------------ */
});
})(this.jQuery);
/**
* jQuery Plugin to obtain touch gestures from iPhone, iPod Touch, iPad, and Android mobile phones
* Common usage: wipe images (left and right to show the previous or next image)
*
* @author Andreas Waltl, netCU Internetagentur (http://www.netcu.de)
*/
(function($){$.fn.touchwipe=function(settings){var config={min_move_x:20,min_move_y:20,wipeLeft:function(){},wipeRight:function(){},wipeUp:function(){},wipeDown:function(){},preventDefaultEvents:true};if(settings)$.extend(config,settings);this.each(function(){var startX;var startY;var isMoving=false;function cancelTouch(){this.removeEventListener('touchmove',onTouchMove);startX=null;isMoving=false}function onTouchMove(e){if(config.preventDefaultEvents){e.preventDefault()}if(isMoving){var x=e.touches[0].pageX;var y=e.touches[0].pageY;var dx=startX-x;var dy=startY-y;if(Math.abs(dx)>=config.min_move_x){cancelTouch();if(dx>0){config.wipeLeft()}else{config.wipeRight()}}else if(Math.abs(dy)>=config.min_move_y){cancelTouch();if(dy>0){config.wipeDown()}else{config.wipeUp()}}}}function onTouchStart(e){if(e.touches.length==1){startX=e.touches[0].pageX;startY=e.touches[0].pageY;isMoving=true;this.addEventListener('touchmove',onTouchMove,false)}}if('ontouchstart'in document.documentElement){this.addEventListener('touchstart',onTouchStart,false)}});return this}})(jQuery);