$(window).load(function() {
$("#status").fadeOut();
$("#preloader").delay(350).fadeOut("slow");
})
new cbpScroller( document.getElementById( 'cbp-so-scroller' ) );
/*global $:false */
$(function(){"use strict";
$('#home').css({'height':($(window).height())+'px'});
$(window).resize(function(){
$('#home').css({'height':($(window).height())+'px'});
});
});
$(document).ready(function() {
$('body').mousewheel(function(event, delta) {
if (delta < 0) {
$('body').scrollTo('+=100', 1500 );
}
else
$('body').scrollTo('-=100', 1500 );
return false;
});
});
/*global $:false */
$(document).ready(function(){"use strict";
$(".scroll").click(function(event){
event.preventDefault();
var full_url = this.href;
var parts = full_url.split("#");
var trgt = parts[1];
var target_offset = $("#"+trgt).offset();
var target_top = target_offset.top - 80;
$('html, body').animate({scrollTop:target_top}, 1400);
});
});
$(function(){
$('ul li a').click(function(){
var item=$(this).parent();
$('ul li').removeClass('current');
item.addClass("current")
});
});
$(document).ready(function(){
$("#navigation").sticky({topSpacing:0});
$("ul#menu").click(function(){
if( $("ul#menu li").css('display') != 'inline' ){
if($("ul#menu").hasClass('showmenu')) {
$("ul#menu").removeClass('showmenu');
$("ul#menu li").css('display','none');
} else {
$("ul#menu").addClass('showmenu');
$("ul#menu li").css('display','block');
}
}
});
$(window).resize(function() {
if( $(window).width() >= 960 ){
if( $("ul#menu li").css('display' ) == 'none' )
$("ul#menu li").css('display','inline');
}
else{
$("ul#menu li").css('display','none');
}
});
});
$(function(){
$('#maximage').maximage({
cycleOptions: {
fx: 'fade',
speed: 1000, // Has to match the speed for CSS transitions in jQuery.maximage.css (lines 30 - 33)
timeout: 4000,
prev: '#arrow_left',
next: '#arrow_right',
pause: 1,
},
onFirstImageLoaded: function(){
jQuery('#cycle-loader').hide();
jQuery('#maximage').fadeIn('slow');
}
});
});
$(function($) {
$(".knob").knob({
change : function (value) {
//console.log("change : " + value);
},
release : function (value) {
//console.log(this.$.attr('value'));
console.log("release : " + value);
},
cancel : function () {
console.log("cancel : ", this);
},
draw : function () {
// "tron" case
if(this.$.data('skin') == 'tron') {
var a = this.angle(this.cv) // Angle
, sa = this.startAngle // Previous start angle
, sat = this.startAngle // Start angle
, ea // Previous end angle
, eat = sat + a // End angle
, r = 1;
this.g.lineWidth = this.lineWidth;
this.o.cursor
&& (sat = eat - 0.3)
&& (eat = eat + 0.3);
if (this.o.displayPrevious) {
ea = this.startAngle + this.angle(this.v);
this.o.cursor
&& (sa = ea - 0.3)
&& (ea = ea + 0.3);
this.g.beginPath();
this.g.strokeStyle = this.pColor;
this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, sa, ea, false);
this.g.stroke();
}
this.g.beginPath();
this.g.strokeStyle = r ? this.o.fgColor : this.fgColor ;
this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, sat, eat, false);
this.g.stroke();
this.g.lineWidth = 2;
this.g.beginPath();
this.g.strokeStyle = this.o.fgColor;
this.g.arc( this.xy, this.xy, this.radius - this.lineWidth + 1 + this.lineWidth * 2 / 3, 0, 2 * Math.PI, false);
this.g.stroke();
return false;
}
}
});
// Example of infinite knob, iPod click wheel
var v, up=0,down=0,i=0
,$idir = $("div.idir")
,$ival = $("div.ival")
,incr = function() { i++; $idir.show().html("+").fadeOut(); $ival.html(i); }
,decr = function() { i--; $idir.show().html("-").fadeOut(); $ival.html(i); };
$("input.infinite").knob(
{
min : 0
, max : 20
, stopper : false
, change : function () {
if(v > this.cv){
if(up){
decr();
up=0;
}else{up=1;down=0;}
} else {
if(v < this.cv){
if(down){
incr();
down=0;
}else{down=1;up=0;}
}
}
v = this.cv;
}
});
});
$(document).ready(function(){
//.parallax(xPosition, speedFactor, outerHeight) options:
//xPosition - Horizontal position of the element
//inertia - speed to move relative to vertical scroll. Example: 0.1 is one tenth the speed of scrolling, 2 is twice the speed of scrolling
//outerHeight (true/false) - Whether or not jQuery should use it's outerHeight option to determine when a section is in the viewport
$('#parallax-1').parallax("50%", 0.2);
$('#parallax-2').parallax("50%", 0.2);
$('#parallax-3').parallax("50%", 0.2);
$('#parallax-4').parallax("50%", 0.1);
});
$(document).ready(function() {
$('
').prependTo('#flkr');
$.getJSON('http://api.flickr.com/services/feeds/photos_public.gne?id=33672800@N00&lang=en-us&format=json&jsoncallback=?', function(data) {
$.each(data.items, function(i,item) {
var squares = (item.media.m).replace('_m.jpg', '_q.jpg');
if(i <= 15){
$('
').attr({
alt: item.title,
src: squares,
height: '115',
width: '115'
}).appendTo('#flkr ul').wrap('');
}
});
});
});
$(document).ready(function(){
$('.slider1').bxSlider({
adaptiveHeight: true,
touchEnabled: true,
pause: 4000,
auto: true,
pager: false
});
});
$(document).ready(function(){
$('.slider2').bxSlider({
touchEnabled: true,
controls: false,
auto: true,
pause: 3000,
pager: false,
slideWidth: 235,
minSlides: 1,
maxSlides: 6,
moveSlides: 1,
slideMargin: 0
});
});
jQuery(document).ready(function () {
(function ($) {
var container = $('.portfolio-isotope');
function getNumbColumns() {
var winWidth = $(window).width(),
columnNumb = 1;
if (winWidth > 1500) {
columnNumb = 3;
} else if (winWidth > 1200) {
columnNumb = 3;
} else if (winWidth > 900) {
columnNumb = 2;
} else if (winWidth > 600) {
columnNumb = 1;
} else if (winWidth > 300) {
columnNumb = 1;
}
return columnNumb;
}
function setColumnWidth() {
var winWidth = $(window).width(),
columnNumb = getNumbColumns(),
postWidth = Math.floor(winWidth / columnNumb);
}
$('#portfolio-filter #filter a').click(function () {
var selector = $(this).attr('data-filter');
$(this).parent().parent().find('a').removeClass('current');
$(this).addClass('current');
container.isotope( {
filter : selector
});
setTimeout(function () {
reArrangeProjects();
}, 300);
return false;
});
function reArrangeProjects() {
setColumnWidth();
container.isotope('reLayout');
}
container.imagesLoaded(function () {
setColumnWidth();
container.isotope( {
itemSelector : '.box',
layoutMode : 'masonry',
resizable : false
} );
} );
$(window).on('debouncedresize', function () {
reArrangeProjects();
} );
} )(jQuery);
} );
/* DebouncedResize Function */
(function ($) {
var $event = $.event,
$special,
resizeTimeout;
$special = $event.special.debouncedresize = {
setup : function () {
$(this).on('resize', $special.handler);
},
teardown : function () {
$(this).off('resize', $special.handler);
},
handler : function (event, execAsap) {
var context = this,
args = arguments,
dispatch = function () {
event.type = 'debouncedresize';
$event.dispatch.apply(context, args);
};
if (resizeTimeout) {
clearTimeout(resizeTimeout);
}
execAsap ? dispatch() : resizeTimeout = setTimeout(dispatch, $special.threshold);
},
threshold : 150
};
} )(jQuery);
$(document).ready(function(){
$(".iframe").colorbox({iframe:true, width:"100%", height:"100%"});
});
$(".group1").colorbox({rel:'group1'});
$(document).ready(function() {
$("#blog").owlCarousel({
navigation : true,
items : 3,
itemsDesktop : [1000,2],
itemsDesktopSmall : [900,2],
itemsTablet: [600,1],
itemsMobile : false
});
});
jQuery(document).ready(function ($) { // wait until the document is ready
$('#send').click(function(){ // when the button is clicked the code executes
$('.error').fadeOut('slow'); // reset the error messages (hides them)
var error = false; // we will set this true if the form isn't valid
var name = $('input#name').val(); // get the value of the input field
if(name == "" || name == " ") {
$('#err-name').fadeIn('slow'); // show the error message
error = true; // change the error state to true
}
var email_compare = /^([a-z0-9_.-]+)@([da-z.-]+).([a-z.]{2,6})$/; // Syntax to compare against input
var email = $('input#email').val(); // get the value of the input field
if (email == "" || email == " ") { // check if the field is empty
$('#err-email').fadeIn('slow'); // error - empty
error = true;
}else if (!email_compare.test(email)) { // if it's not empty check the format against our email_compare variable
$('#err-emailvld').fadeIn('slow'); // error - not right format
error = true;
}
if(error == true) {
$('#err-form').slideDown('slow');
return false;
}
var data_string = $('#ajax-form').serialize(); // Collect data from form
alert(data_string);
$.ajax({
type: "POST",
url: $('#ajax-form').attr('action'),
data: data_string,
timeout: 6000,
error: function(request,error) {
if (error == "timeout") {
$('#err-timedout').slideDown('slow');
}
else {
$('#err-state').slideDown('slow');
$("#err-state").html('An error occurred: ' + error + '');
}
},
success: function() {
$('#ajax-form').slideUp('slow');
$('#ajaxsuccess').slideDown('slow');
}
});
return false; // stops user browser being directed to the php file
}); // end click function
});