1// MAIN.JS 2//-------------------------------------------------------------------------------------------------------------------------------- 3//This is main JS file that contains custom JS scipts and initialization used in this template*/ 4// ------------------------------------------------------------------------------------------------------------------------------- 5// Template Name: PRESENCE. 6// Author: Designova. 7// Version 1.0 - Initial Release 8// Website: http://www.designova.net 9// Copyright: (C) 2014 10// ------------------------------------------------------------------------------------------------------------------------------- 11 12/*global $:false */ 13/*global window: false */ 14 15(function(){ 16 "use strict"; 17 18 19$(function ($) { 20 21 //Detecting viewpot dimension 22 var vH = $(window).height(); 23 var vW = $(window).width(); 24 25 //Adjusting Intro Components Spacing based on detected screen resolution 26 $('#slide1, #inro, .intro-carousel, .intro-carousel .item').css('height',vH); 27 28 29 //Vertical Centering of natural content spcific elements (non-images) 30 $(function ($) { 31 /*if your element is an image then please use $(window).load() instead tha above function wrap, because we want the coding to take 32 effect when the image is loaded. */ 33 //get the width of the parent 34 var parent_height = $('.vertical-center').parent().height(); 35 var image_height = $('.vertical-center').height(); 36 var top_margin = (parent_height - image_height)/2; 37 //center it 38 $('.vertical-center').css( 'padding-top' , top_margin); 39 //uncomment the following if ithe element to be centered is an image 40 $('.vertical-center-img').css( 'margin-top' , top_margin); 41 $('.vertical-center-fp').css( 'top' , top_margin); 42 }); 43 44 //Horizontal Centering of natural content specific elements (non-css method) 45 $(function ($) { 46 var floatingContentWidth = $('.horizontal-center').width(); 47 var floatingParentWidth = $('.horizontal-center').parent().width(); 48 var setLeft = (floatingParentWidth-floatingContentWidth)/2; 49 //alert(setLeft); 50 $('.horizontal-center').css('left',setLeft); 51 }); 52 53 54 55 56 57//Equi-heigh Divs 58$(document).ready(function() { 59 60 if(vW > 1000) 61 { 62 var maxHeight = -1; 63 64 $('.equal-height-one').each(function() { 65 maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height(); 66 }); 67 68 $('.equal-height-one').each(function() { 69 $(this).height(maxHeight); 70 }); 71 72 73 var maxHeight2 = -1; 74 75 $('.equal-height-two').each(function() { 76 maxHeight2 = maxHeight2 > $(this).height() ? maxHeight2 : $(this).height(); 77 }); 78 79 $('.equal-height-two').each(function() { 80 $(this).height(maxHeight2); 81 }); 82 83 84 var maxHeight3 = -1; 85 86 $('.equal-height-three').each(function() { 87 maxHeight3 = maxHeight3 > $(this).height() ? maxHeight3 : $(this).height(); 88 }); 89 90 $('.equal-height-three').each(function() { 91 $(this).height(maxHeight3); 92 }); 93 94} 95 96 }); 97 98 99 100 //Portfolio Engine 101 $('#grid').mixitup({ 102 transitionSpeed : 800 103 }); 104 105 //Portfolio Filter Active State 106 $('ul#portfolioFilter li').click(function(){ 107 $('ul#portfolioFilter li').removeClass('active-filter'); 108 $(this).addClass('active-filter'); 109 }); 110 111 112 113 //TWITTER INIT (Updated with compatibility on Twitter's new API): 114 //PLEASE READ DOCUMENTATION FOR INFO ABOUT SETTING UP YOUR OWN TWITTER CREDENTIALS: 115 $(function ($) { 116 $('#ticker').tweet({ 117 modpath: './twitter/', 118 count: 1, 119 loading_text: 'getting the tweets...', 120 username:'jenbranstrom' 121 /* etc... */ 122 }); 123 }); 124 125 126 127 //Setup waypoints plugin 128 $('.about-inner-bg').waypoint(function (event, direction) { 129 130 //If the user scrolls up change the navigation link that has the same data-sli
130de attribute as the slide to active and 131 //remove the active class from the previous navigation link 132 if (direction === 'down') { 133 $(this).animate({ 134 'background-size': '150%' 135 }, 15000, 'linear'); 136 } 137 // else If the user scrolls down change the navigation link that has the same data-slide attribute as the slide to active and 138 //remove the active class from the next navigation link 139 else { 140 $(this).animate({ 141 'background-size': '100%' 142 }, 15000, 'linear'); 143 } 144 145 }, { offset: 150 }); 146 147 148}); 149// $(function ($) : ends 150 151})(); 152// JSHint wrapper $(function ($) : ends 153 154 155 156 157 158 159 160 161
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.