jquery(document).ready(function() { // -------------------------------------------------- // sticky header // -------------------------------------------------- jquery(window).scroll(function(){ if (jquery(this).scrolltop() > 50){ jquery('body').addclass("sticky-2"); jquery('header').addclass("sticky-1"); jquery('header .info').addclass('h_info_hide'); } else{ // -------------------------------------------------- //back to default styles // -------------------------------------------------- jquery('body').removeclass("sticky-2"); jquery('header').removeclass("sticky-1"); jquery('header .info').removeclass('h_info_hide'); } }); /* window.onresize = function(event) { jquery('#gallery').isotope('relayout'); };*/ // -------------------------------------------------- // prettyphoto function // -------------------------------------------------- jquery("area[rel^='prettyphoto']").prettyphoto(); jquery(".gallery:first a[rel^='prettyphoto']").prettyphoto({animation_speed:'fast',theme:'pp_default',slideshow:3000, autoplay_slideshow: false}); jquery(".gallery:gt(0) a[rel^='prettyphoto']").prettyphoto({animation_speed:'fast',slideshow:10000, hideflash: true}); jquery("#custom_content a[rel^='prettyphoto']:first").prettyphoto({ custom_markup: '
', changepicturecallback: function(){ initialize(); } }); jquery("#custom_content a[rel^='prettyphoto']:last").prettyphoto({ custom_markup: '
', changepicturecallback: function(){ _bsap.exec(); } }); // -------------------------------------------------- // scroll to top // -------------------------------------------------- //jquery().uitotop({ easingtype: 'easeoutquart' }); // -------------------------------------------------- // lazyload // -------------------------------------------------- jquery(function() { jquery("img").lazyload({ effect : "fadein", effectspeed: '1000' }); }); // -------------------------------------------------- // gallery hover // -------------------------------------------------- jquery('.overlay').fadeto(1, 0); jquery(".item .picframe").hover( function() { jquery(this).parent().find(".overlay").width(jquery(this).find("img").css("width")); jquery(this).parent().find(".overlay").height(jquery(this).find("img").css("height")); jquery(this).parent().find(".overlay").fadeto(150, 1); picheight = jquery(this).find("img").css("height"); newheight = (picheight.substring(0, picheight.length - 2)/2)-48; //alert(newheight); jquery(this).parent().find(".info-area").animate({'margin-top': newheight},'fast'); }, function() { jquery(this).parent().find(".info-area").animate({'margin-top': '10%'},'fast'); jquery(this).parent().find(".overlay").fadeto(150, 0); }) // team hover jquery(".team .picframe").hover( function() { jquery(this).parent().find(".overlay").width(jquery(this).find("img.team-pic").css("width")); jquery(this).parent().find(".overlay").height(jquery(this).find("img.team-pic").css("height")); jquery(this).parent().find(".overlay").fadeto(150, 1); picheight = jquery(this).find("img.team-pic").css("height"); newheight = (picheight.substring(0, picheight.length - 2)/2)-24; //alert(newheight); jquery(this).parent().find(".sb-icons").animate({'margin-top': newheight},'fast'); }, function() { jquery(this).parent().find(".sb-icons").animate({'margin-top': '10%'},'fast'); jquery(this).parent().find(".overlay").fadeto(150, 0); }) jquery(window).load(function() { // -------------------------------------------------- // filtering gallery // -------------------------------------------------- var $container = jquery('#gallery'); /* $container.isotope({ itemselector: '.item', filter: '*', });*/ jquery('#filters a').click(function(){ var $this = jquery(this); if ( $this.hasclass('selected') ) { return false; } var $optionset = $this.parents(); $optionset.find('.selected').removeclass('selected'); $this.addclass('selected'); var selector = jquery(this).attr('data-filter'); $container.isotope({ filter: selector, }); return false; }); // -------------------------------------------------- // flexslider // -------------------------------------------------- jquery('.project-carousel.flexslider').flexslider({ animation: "slide", animationloop: true, slideshow: false, itemwidth: 180, itemmargin: 0, minitems: 2, maxitems: 4 }); jquery('.testi-slider.flexslider').flexslider({ animation: "fade" }); jquery('.project-carousel-3-col.flexslider').flexslider({ animation: "slide", animationloop: true, slideshow: false, itemwidth: 180, itemmargin: 0, minitems: 1, maxitems: 3 }); jquery('.logo-carousel.flexslider').flexslider({ animation: "slide", animationloop: true, slideshow: true, itemwidth: 120, itemmargin: 0, minitems: 1, maxitems: 6 }); }); jquery('.next-slider').click(function () { jquery('.flexslider.pf-carousel').flexslider("next"); }); jquery('.prev-slider').click(function () { jquery('.flexslider.pf-carousel').flexslider("prev"); }); // responsive slides jquery(function () { // slideshow 4 jquery(".pic_slider").responsiveslides({ auto: false, pager: false, nav: true, speed: 500, namespace: "callbacks", before: function () { jquery('.events').append("
  • before event fired.
  • "); }, after: function () { jquery('.events').append("
  • after event fired.
  • "); } }); }); // -------------------------------------------------- // tabs // -------------------------------------------------- jquery('.de_tab').find('.de_tab_content div').hide(); jquery('.de_tab').find('.de_tab_content div:first').show(); jquery('.de_nav li').click(function() { jquery(this).parent().find('li span').removeclass("active"); jquery(this).find('span').addclass("active"); jquery(this).parent().parent().find('.de_tab_content div').hide(); var indexer = jquery(this).index(); //gets the current index of (this) which is #nav li jquery(this).parent().parent().find('.de_tab_content div:eq(' + indexer + ')').fadein(); //uses whatever index the link has to open the corresponding box }); });