/*****************************************************************
* **************************************************************
* @MetCreative - Table of Contents
* 1-) Document Ready State
* a- Scroll Speed and Styling
* b- Skill Circles
* c- LightBox
* d- DL Menu
* e- Icon Navigation Tabs
* f- Latest Posts Carousel
* h- Latest Tweets
* i- Twitter Ticker
* j- Gmaps JS for Google Maps
* h- Php Ajax Contact Form
* l- Blog List Iframe Sizing
* m- Portfolio List Iframe Sizing
* n- Contact Page Contact Form
* o- Responsive Navigation
* p- Full Screen Background Image
* r- Testimonials
* 2-) Window Load State
* a- Index Slider
* b- Portfolio List Slider
* c- Blog Slider
* d- Recent Works Carousel
* d- Cacoon Slider
* 2-) Functions
* a- Sticky Header
* b- Sticky Header Resizing
* !Note: You can make search with one of the title above to find the block according to it
* **************************************************************
*****************************************************************/
$(document).ready(function(){
/**
* Scroll Speed and Styling
* @usedPlugins jquery,nicescroll
* @usedAt Every page that contains body tag with data-smooth-scrolling 1
*/
if($('body').attr('data-smooth-scrolling') == 1 && !jQuery.browser.mobile){
$("html").niceScroll({
scrollspeed: 60,
mousescrollstep: 35,
cursorwidth: 10,
cursorborder: '1px solid #7E8A96',
cursorcolor: '#18ADB6',
cursorborderradius: 10,
autohidemode: false,
cursoropacitymin: 0.1,
cursoropacitymax: 1
});
}
/**
* Skill Circles
* @usedPlugins jquery, jquery.knob, jquery.easing
* @usedAt services page
*/
var container = $('.dial');
container.each(function() {
var that = $(this),
ao = Math.round(Math.random() * 360),
w = container.data('width'),
v = that.data('value');
that.addClass('visible').knob({
readOnly: true,
bgColor: '#ebebeb',
fgColor: '#18ADB5',
thickness: 0.25,
angleOffset: ao,
width: w
});
$({value: 0}).animate({value: v}, {
duration: 2000,
easing:'easeOutQuad',
step: function() {
that.val(Math.ceil(this.value)).trigger('change');
}
})
});
/**
* LightBox
* @usedPlugins jquery, magnific-popup
* @usedAt portfolio
*/
$('[rel*="lb"]').each(function(){
$('[rel="'+$(this).attr('rel')+'"]').magnificPopup({
type: 'image',
gallery:{
enabled: true
}
});
});
/**
* DL Menu
* @usedPlugins jquery, dlmenu
* @usedAt shortcode
*/
$( '#dl-menu' ).dlmenu({
animationClasses : { 'in' : 'dl-animate-in-3', 'out' : 'dl-animate-out-3' }
});
/**
* Icon Navigation Tabs
* @usedPlugins jquery
* @usedAt Icon Navigation Tabs on Index Page
*/
$('.met_icon_tabs nav a').click(function(e){
e.preventDefault();
if(!$(this).hasClass('met_active_tab')){
var tabContainer = $(this).parents('.met_icon_tabs');
var href = $(this).attr('href');
tabContainer.find('.met_active_tab').removeClass('met_active_tab');
tabContainer.find('.met_open_tab').removeClass('met_open_tab');
$(this).addClass('met_active_tab');
$(this).addClass('met_active_tab');
tabContainer.find(href).addClass('met_open_tab');
}
});
/**
* Latest Posts Carousel
* @usedPlugins jquery,caroufredsel
* @usedAt Latest Posts on Index Page
*/
$(".met_latest_posts").carouFredSel({
responsive: true,
pagination : {
container : $('.met_latest_posts_pages'),
anchorBuilder : function(nr) {
return '';
}
},
circular: false,
infinite: true,
auto: {
play : true,
pauseDuration: 0,
duration: 2000
},
scroll: {
duration: 400,
wipe: true,
pauseOnHover: true
},
items: {
visible: {
min: 1,
max: 1 },
height: 'auto'
},
direction: 'up',
onCreate: function(){
$(window).trigger('resize');
}
});
/**
* Latest Tweets
* @usedPlugins jquery,caroufredsel
* @usedAt Latest Tweets on Index Page
*/
if($('.met_twitter_wrapper').length > 0){
$.getJSON('twitter/get-tweets1.1.php?placement=onMiddle',
function(feeds) {
$('.met_twitter_wrapper').html('');
for (var i=0; i