1var $ = jQuery.noConflict(); 2 3 4 5//TOGGLE------------------------------------------------------- 6$(document).ready(function () { 7 8 $('#toggle-view li').click(function () { 9 10 var text = $(this).children('div.panel'); 11 12 if (text.is(':hidden')) { 13 text.slideDown('10'); 14 $(this).children('.ui-accordion-header').addClass('ui-accordion-header-active'); 15 } else { 16 text.slideUp('10'); 17 $(this).children('.ui-accordion-header').removeClass('ui-accordion-header-active'); 18 } 19 20 }); 21 22}); 23 24//ACCORDION----------------------------------------------------- 25$(document).ready(function() { 26 $("#accordion").accordion({ 27 autoHeight: false 28 /*icons: { "header": "plus", "headerSelected": "minus" }*/ 29 }); 30}); 31 32 33 34//FANCYBOX------------------------------------------------------- 35$(document).ready(function() { 36 37 $(".lightbox").on("mousedown", function() 38 { 39 $(this).fancybox( 40 { 41 'titleShow' : false, 42 'overlayShow' : false, 43 'transitionIn' : 'elastic', 44 'transitionOut' : 'elastic' 45 }); 46 }); 47 $("a.iframe").fancybox( 48 49 { 50 'titleShow' : true, 51 'autoDimensions' : true, 52 'width' : 800, 53 'height' : 450, 54 'autoScale' : true, 55 'type' : 'iframe' 56 57 }); 58 59 $('a[rel="gallery"].lightbox1').fancybox(); 60}); 61 62//PORTFOLIO FILTER------------------------------------------------ 63$(document).ready(function(){ 64 65 // Clone portfolio items to get a second collection for Quicksand plugin 66 var $portfolioClone = $("#portfolio").clone(); 67 68 // Attempt to call Quicksand on every click event handler 69 $("#filter a").click(function(e){ 70 71 $("#filter li").removeClass("current"); 72 73 // Get the class attribute value of the clicked link 74 var $filterClass = $(this).parent().attr("class"); 75 76 if ( $filterClass == "all" ) { 77 var $filteredPortfolio = $portfolioClone.find("li"); 78 } else { 79 var $filteredPortfolio = $portfolioClone.find("li[data-type~=" + $filterClass + "]"); 80 } 81 82 // Call quicksand 83 $("#portfolio").quicksand( $filteredPortfolio, { 84 duration: 800, 85 easing: 'swing' 86 }); 87 88 89 $(this).parent().addClass("current"); 90 91 }) 92}); 93 94//CONTENT TABS--------------------------------------------------- 95$(document).ready(function() { 96 97 var $tabsNav = $('.tabs-nav'), 98 $tabsNavLis = $tabsNav.children('li'), 99 $tabContent = $('.tab-content'); 100 101 $tabsNav.each(function() { 102 var $this = $(this); 103 104 $this.next().children('.tab-content').stop(true,true).hide() 105 .first().show(); 106 107 $this.children('li').first().addClass('active').stop(true,true).show(); 108 }); 109 110 $tabsNavLis.on('click', function(e) { 111 var $this = $(this); 112 113 $this.siblings().removeClass('active').end() 114 .addClass('active'); 115 116 $this.parent().next().children('.tab-content').stop(true,true).hide() 117 .siblings( $this.find('a').attr('href') ).fadeIn(); 118 119 e.preventDefault(); 120 }); 121 122}); 123 124//FLICKR FEED---------------------------------------------------- 125$(document).ready(function() { 126 $('#flickrfeed').jflickrfeed({ 127 limit: 6, 128 qstrings: { 129 id: '91212552@N07' 130 }, 131 itemTemplate: 132 '<li>' + 133 '<a class="lightbox" rel="colorbox" href="{{image}}" title="{{title}}">' + 134 '<img src="{{image_s}}" alt="{{title}}" />' + 135 '</a>' + 136 '</li>' 137 }, function(data) { 138 $(".lightbox").fancybox({ 139 'overlayShow' : false, 140 'transitionIn' : 'elastic', 141 'transitionOut' : 'elastic' 142 }); 143 }); 144}); 145 146//FORM VALIDATION JAVASCRIPT---------------------------------------------------- 147$(document).ready(function() { 148 $('form#contact-form').submit(function() { 149 $('form#contact-form .styled-box.iconed-box.error').remove(); 150 var hasError = false; 151 $('.requiredField').each(function() { 152 if(jQuery.trim($(this).val()) == '') { 153 var labelText = $(this).prev('label').text(); 154 $(this).parent().append('<div class="styled-box iconed-box error">You forgot to enter your '+labelText+'</div>'); 155 $(this).addClass('inputError'); 156 hasError = true; 157 } else if($(this).hasClass('email')) { 158 var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; 159 if(!emailReg.test(jQuery.trim($(this).val()))) { 160 var labelText = $(this).prev('label').text(); 161 $(this).parent().append('<div class="styled-box iconed-box error">
161You entered an invalid '+labelText+'</div>'); 162 $(this).addClass('inputError'); 163 hasError = true; 164 } 165 } 166 }); 167 if(!hasError) { 168 $('form#contact-form input.submit').fadeOut('normal', function() { 169 $(this).parent().append(''); 170 }); 171 var formInput = $(this).serialize(); 172 $.post($(this).attr('action'),formInput, function(data){ 173 $('form#contact-form').slideUp("fast", function() { 174 $(this).before('<p class="styled-box iconed-box success">Your email was successfully sent. We will contact you as soon as possible.</p>'); 175 }); 176 }); 177 } 178 179 return false; 180 181 }); 182}); 183 184//SCROLL TO TOP---------------------------------------------------- 185$(document).ready(function(){ 186 187 // hide #back-top first 188 $("#back-top").hide(); 189 190 // fade in #back-top 191 $(function () { 192 $(window).scroll(function () { 193 if ($(this).scrollTop() > 100) { 194 $('#back-top').fadeIn(); 195 } else { 196 $('#back-top').fadeOut(); 197 } 198 }); 199 200 // scroll body to 0px on click 201 $('#back-top a').click(function () { 202 $('body,html').animate({ 203 scrollTop: 0 204 }, 600); 205 return false; 206 }); 207 }); 208 209 }); 210 211 212 213//BLACK & WHITE HOVER EFFECT-------------------------------------- 214$(window).load(function(){ 215 $('.bw-wrapper').BlackAndWhite({ 216 hoverEffect : true, // default true 217 speed: { //this property could also be just speed: value for both fadeIn and fadeOut 218 fadeIn: 200, // 200ms for fadeIn animations 219 fadeOut: 300 // 800ms for fadeOut animations 220 } 221 }); 222}); 223/*----------------------------------------------------*/ 224/* Skill Bar Animation 225/*----------------------------------------------------*/ 226 227 setTimeout(function(){ 228 229 $('.skill-bar .skill-bar-content').each(function() { 230 var me = $(this); 231 var perc = me.attr("data-percentage"); 232 233 var current_perc = 0; 234 235 var progress = setInterval(function() { 236 if (current_perc>=perc) { 237 clearInterval(progress); 238 } else { 239 current_perc +=1; 240 me.css('width', (current_perc)+'%'); 241 } 242 243 me.text((current_perc)+'%'); 244 245 }, 8); 246 247 }); 248 249 },8); 250 251//CAROUSEL-------------------------------------------------------- 252 253(function($){ 254 $(document).ready(function(){ 255 256// Add classes for other carousels 257var $carousel = $('.latest-work-jc, .latest-posts-jc, .testimonials-jc'); 258 259var scrollCount; 260 261function adjustScrollCount() { 262 if( $(window).width() < 768 ) { 263 scrollCount = 1; 264 } else { 265 scrollCount = 1; 266 } 267 268} 269 270function adjustCarouselHeight() { 271 272 $carousel.each(function() { 273 var $this = $(this); 274 var maxHeight = -1; 275 $this.find('li').each(function() { 276 maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height(); 277 }); 278 $this.height(maxHeight); 279 }); 280} 281function initCarousel() { 282 adjustCarouselHeight(); 283 adjustScrollCount(); 284 var i = 0; 285 var g = {}; 286 $carousel.each(function() { 287 i++; 288 289 var $this = $(this); 290 g[i] = $this.jcarousel({ 291 animation : 500, 292 scroll : scrollCount, 293 wrap: 'circular' 294 }); 295 $this.jcarousel('scroll', 0); 296 $this.prev().find('.jcarousel-prev').bind('active.jcarouselcontrol', function() { 297 $(this).addClass('active'); 298 }).bind('inactive.jcarouselcontrol', function() { 299 $(this).removeClass('active'); 300 }).jcarouselControl({ 301 target: '-='+scrollCount, 302 carousel: g[i] 303 }); 304 305 $this.prev().find('.jcarousel-next').bind('active.jcarouselcontrol', function() { 306 $(this).addClass('active'); 307 }).bind('inactive.jcarouselcontrol', function() { 308 $(this).removeClass('active'); 309 }).jcarouselControl({ 310 target: '+='+scrollCount, 311 carousel: g[i] 312 }); 313 314 $this.touchwipe({ 315 wipeLeft: function() { 316 $this.jcarousel('scroll','+='+scrollCount); 317 }, 318 wipeRight: function() { 319 $this.jcarousel('scroll','-='+scrollCount); 320 } 321 }); 322 323 }); 324} 325$(window).load(function(){ 326 initCarousel(); 327}); 328 329$(window).resize(function () { 330 $carousel.each(function() { 331 var $this = $(this); 332 $this.jcarousel('destroy'); 333 }); 334 initCarousel(); 335}); 336 337 338}); 339 340})(this.jQuery); 341 342/** 343 * jQuery Plugin to obtain touch gestures from iPhone, iPod Touch and iPad, should also work with Android mobile phones (not tested yet!) 344 * Common usage: wipe images (left and right to show the previous or next image) 345 * 346 * @author Andreas Waltl, netCU Internetagentur (http://www.netcu.de) 347 * @version 1.1.1 (9th December 2010) - fix bug (older IE's had problems) 348 * @version 1.1 (1st September 2010) - support wipe up and wipe down 349 * @version 1.0 (15th July 2010) 350 */ 351(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);
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.