jQuery(document).ready(function() { //lavalamp menu jQuery('#navi2').lavaLamp({ fx: 'easeOutBack', speed: 800, }); //hover functionality for images jQuery('.proj-img').hover(function() { jQuery(this).find('i').stop().animate({ opacity: 0.8 }, 'fast'); jQuery(this).find('a').stop().animate({ "top": "0" }); }, function() { jQuery(this).find('i').stop().animate({ opacity: 0 }, 'fast'); jQuery(this).find('a').stop().animate({ "top": "-600px" }); }); jQuery('#slider').cycle({ fx: 'fade', pager: '.buttonCon', next: '.nextNav', prev: '.prevNav', slides: '> .oneByOne_item' }); jQuery("a[rel^='prettyPhoto']").prettyPhoto(); jQuery('#navi2').mobileMenu({ defaultText: 'Navigate to...', className: 'mobile-menu', subMenuDash: '–' }); //sliding.js code var Duration = 250; //time in milliseconds jQuery('#sub-navi a').hover(function() { jQuery(this).animate({ marginTop: '5px' }, Duration); }, function() { jQuery(this).animate({ marginTop: '0px' }, Duration); }); jQuery('#backtotop a').hover(function() { jQuery(this).animate({ marginTop: '5px' }, Duration); }, function() { jQuery(this).animate({ marginTop: '0px' }, Duration); }); //tabs code jQuery(".tabs").idTabs(function(id,list,set){ jQuery(this).parent().parent().find('a').removeClass('selected'); jQuery(this).addClass("selected"); for(i in list) jQuery(list[i]).hide(); jQuery(id).fadeIn(); return false; }); //settings the width for the menu so it doesn't overlap with the phone number jQuery(window).on('resize', function() { var navi2 = jQuery('#navi2'), phone = jQuery('#phone-number'), container = jQuery('#container'), position = navi2.find('li.menu-item') .first() .position() .top; navi2.css("width", container.width() - phone.outerWidth() - 110); jQuery("#navi2 > li.menu-item").each(function() { jQuery(this).show(); if(jQuery(this).position().top !== position) jQuery(this).css("display", "none"); }); navi2.css("width", ""); }); jQuery(window).trigger('resize'); jQuery('input#send').on('click', function(){ var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/, message = jQuery("div#message"), email = jQuery("input#email").val(); message.hide(); message.html(""); if(jQuery('input#name').val() === "") message.append("
"); if(email === "") message.append(" "); else if(!emailReg.test(email)) message.append(" "); if(jQuery('input#phone').val() === "") message.append(" "); if(jQuery('input#captcha').val() === "") message.append(" "); if(jQuery('textarea#comments').val() === "") message.append(" "); jQuery('#message').slideDown('slow'); if(message.html() !== '') return false; }); } );