jQuery(document).ready(function($) { var color = "orange"; // tealgreen, green, red, pink, purple, orange, navyblue, magenta, cream, blue, yellow var css_url = "css/colors/color-" + color + ".css"; $('head').append(''); }) function is_touch_device() { return !!('ontouchstart' in window); } /*-------------------------------------------------- DROPDOWN MENU ---------------------------------------------------*/ /* * Superfish v1.4.8 - jQuery menu widget * Copyright (c) 2008 Joel Birch * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt */ (function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,$arrow=$([' »'].join("")),over=function(){var $$=$(this),menu=getMenu($$);clearTimeout(menu.sfTimer);$$.showSuperfishUl().siblings().hideSuperfishUl();},out=function(){var $$=$(this),menu=getMenu($$),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){o.retainPath=($.inArray($$[0],o.$path)>-1);$$.hideSuperfishUl();if(o.$path.length&&$$.parents(["li.",o.hoverClass].join("")).length<1){over.call(o.$path);}},o.delay);},getMenu=function($menu){var menu=$menu.parents(["ul.",c.menuClass,":first"].join(""))[0];sf.op=sf.o[menu.serial];return menu;},addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone());};return this.each(function(){var s=this.serial=sf.o.length;var o=$.extend({},sf.defaults,op);o.$path=$("li."+o.pathClass,this).slice(0,o.pathLevels).each(function(){$(this).addClass([o.hoverClass,c.bcClass].join(" ")).filter("li:has(ul)").removeClass(o.pathClass);});sf.o[s]=sf.op=o;$("li:has(ul)",this)[($.fn.hoverIntent&&!o.disableHI)?"hoverIntent":"hover"](over,out).each(function(){if(o.autoArrows){addArrow($(">a:first-child",this));}}).not("."+c.bcClass).hideSuperfishUl();var $a=$("a",this);$a.each(function(i){var $li=$a.eq(i).parents("li");$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});});o.onInit.call(this);}).each(function(){var menuClasses=[c.menuClass];if(sf.op.dropShadows&&!($.browser.msie&&$.browser.version<7)){menuClasses.push(c.shadowClass);}$(this).addClass(menuClasses.join(" "));});};var sf=$.fn.superfish;sf.o=[];sf.op={};sf.IE7fix=function(){var o=sf.op;if($.browser.msie&&$.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined){this.toggleClass(sf.c.shadowClass+"-off");}};sf.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator",shadowClass:"sf-shadow"};sf.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},speed:"normal",autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};$.fn.extend({hideSuperfishUl:function(){var o=sf.op,not=(o.retainPath===true)?o.$path:"";o.retainPath=false;var $ul=$(["li.",o.hoverClass].join(""),this).add(this).not(not).removeClass(o.hoverClass).find(">ul").hide().css("visibility","hidden");o.onHide.call($ul);return this;},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+"-off",$ul=this.addClass(o.hoverClass).find(">ul:hidden").css("visibility","visible");sf.IE7fix.call($ul);o.onBeforeShow.call($ul);$ul.animate(o.animation,o.speed,function(){sf.IE7fix.call($ul);o.onShow.call($ul);});return this;}});})(jQuery); /*-------------------------------------------------- ADDITIONAL CODE FOR DROPDOWN MENU ---------------------------------------------------*/ jQuery(document).ready(function($) { $('ul.menu').superfish({ delay: 100, // one second delay on mouseout animation: {opacity:'show',height:'show'}, // fade-in and slide-down animation speed: 'fast', // faster animation speed autoArrows: false // disable generation of arrow mark-up }); }); /*************************************************** PORTFOLIO ITEM IMAGE HOVER ***************************************************/ $(window).load(function(){ $(".portfolio-grid ul li .item-info-overlay").hide(); if( is_touch_device() ){ $(".portfolio-grid ul li").click(function(){ var count_before = $(this).closest("li").prevAll("li").length; var this_opacity = $(this).find(".item-info-overlay").css("opacity"); var this_display = $(this).find(".item-info-overlay").css("display"); if ((this_opacity == 0) || (this_display == "none")) { $(this).find(".item-info-overlay").fadeTo(250, 1); } else { $(this).find(".item-info-overlay").fadeTo(250, 0); } $(this).closest("ul").find("li:lt(" + count_before + ") .item-info-overlay").fadeTo(250, 0); $(this).closest("ul").find("li:gt(" + count_before + ") .item-info-overlay").fadeTo(250, 0); }); } else{ $(".portfolio-grid ul li").hover(function(){ $(this).find(".item-info-overlay").fadeTo(250, 1); }, function() { $(this).find(".item-info-overlay").fadeTo(250, 0); }); } }); /*************************************************** DUPLICATE H3 & H4 IN PORTFOLIO ***************************************************/ $(window).load(function(){ $(".item-info").each(function(i){ $(this).next().prepend($(this).html()) }); }); /*************************************************** TOGGLE STYLE ***************************************************/ jQuery(document).ready(function($) { $(".toggle-container").hide(); $(".trigger").toggle(function(){ $(this).addClass("active"); }, function () { $(this).removeClass("active"); }); $(".trigger").click(function(){ $(this).next(".toggle-container").slideToggle(); }); }); /*************************************************** ACCORDION ***************************************************/ $(document).ready(function(){ $('.trigger-button').click(function() { $(".trigger-button").removeClass("active") $('.accordion').slideUp('normal'); if($(this).next().is(':hidden') == true) { $(this).next().slideDown('normal'); $(this).addClass("active"); } }); $('.accordion').hide(); }); $(document).ready(function(){ $('.trigger-button-white').click(function() { $(".trigger-button-white").removeClass("active") $('.accordion').slideUp('normal'); if($(this).next().is(':hidden') == true) { $(this).next().slideDown('normal'); $(this).addClass("active"); } }); $('.accordion').hide(); }); /*************************************************** SLIDING GRAPH ***************************************************/ jQuery(document).ready(function($){ function isScrolledIntoView(id) { var elem = "#" + id; var docViewTop = $(window).scrollTop(); var docViewBottom = docViewTop + $(window).height(); if ($(elem).length > 0){ var elemTop = $(elem).offset().top; var elemBottom = elemTop + $(elem).height(); } return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom) && (elemBottom <= docViewBottom) && (elemTop >= docViewTop) ); } function sliding_horizontal_graph(id, speed){ //alert(id); $("#" + id + " li span").each(function(i){ var j = i + 1; var cur_li = $("#" + id + " li:nth-child(" + j + ") span"); var w = cur_li.attr("class"); cur_li.animate({width: w + "%"}, speed); }) } function graph_init(id, speed){ $(window).scroll(function(){ if (isScrolledIntoView(id)){ sliding_horizontal_graph(id, speed); } else{ //$("#" + id + " li span").css("width", "0"); } }) if (isScrolledIntoView(id)){ sliding_horizontal_graph(id, speed); } } graph_init("example-1", 1000); }); /*-------------------------------------------------- ADDITIONAL CODE GRID LIST ---------------------------------------------------*/ (function($){ $.fn.extend({ bra_last_last_row: function() { return this.each(function() { $(this).each(function(){ var no_of_items = $(this).find("li").length; var no_of_cols = Math.round($(this).width() / $(this).find(":first").width() ); var no_of_rows = Math.ceil(no_of_items / no_of_cols); var last_row_start = (no_of_rows - 1) * no_of_cols - 1; if (last_row_start < (no_of_cols - 1)) { last_row_start = 0; $(this).find("li:eq(" + last_row_start + ")").addClass("last-row"); } $(this).find("li:nth-child(" + no_of_cols + "n+ " + no_of_cols + ")").addClass("last"); $(this).find("li:gt(" + last_row_start + ")").addClass("last-row"); }) }); // return this.each } }); })(jQuery); jQuery(document).ready(function($) { $('.grid').bra_last_last_row(); //$(window).resize(function() { //$('.grid').bra_last_last_row(); //}); }) /*************************************************** SELECT MENU ON SMALL DEVICES ***************************************************/ jQuery(document).ready(function($){ var $menu_select = $("