/* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */ (function($){ $(document).bind('ready', function() { // Accordion menu $('.menu-sidebar').accordionMenu({ mode:'slide' }); // Dropdown menu //$('#menu').droplineMenu({fancy:{mode:'move'}}); // Smoothscroller $('a[href="#page"]').smoothScroller({ duration: 500 }); // Fix Browser Rounding $('.grid-block').matchWidth('.grid-h'); var matchHeight = function() { // Match height of div tags $('#top-a .grid-h').matchHeight('.deepest'); $('#top-b .grid-h').matchHeight('.deepest'); $('#bottom-a .grid-h').matchHeight('.deepest'); $('#bottom-b .grid-h').matchHeight('.deepest'); $('#innertop .grid-h').matchHeight('.deepest'); $('#innerbottom .grid-h').matchHeight('.deepest'); $('#maininner, #sidebar-a, #sidebar-b').matchHeight(); $('.wrapper').css("min-height", $(window).height()); }; matchHeight(); $(window).bind('load',function(){ $('#menu').trigger("menu:fixfancy"); matchHeight(); }); }); $.fn.droplineMenu = function(options){ var defaults = { fancy: null }; return this.each(function(){ var ele = $(this), level1 = ele.find("li.level1"), level2 = ele.find("li.level2"), ul2s = ele.find("ul.level2").hide(); dropdowns = ele.find("div.dropdown"), options = $.extend({}, defaults, options); level1.each(function(index){ var li1 = $(this), ul2 = li1.find("ul.level2:first"); if(li1.hasClass("active") && li1.hasClass("active")){ ul2.show().addClass("remain"); } li1.bind("mouseenter", function(){ if(ul2.hasClass("remain")) return; ul2s.stop().hide().removeClass("remain"); if (ul2.length) { if($.browser.msie && $.browser.version<8){ ul2.show().addClass("remain"); }else{ ul2.stop().css("opacity",0).show().animate({opacity:1}).addClass("remain"); } } ele.trigger("menu:enter", [li1, index]); }); }); level2.each(function(i){ var li2 = $(this), dropdown = li2.find("div.dropdown"); li2.bind("mouseenter", function(){ dropdowns.stop().hide(); if (dropdown.length) { if($.browser.msie && $.browser.version<8){ dropdown.show(); }else{ dropdown.stop().show().css("opacity",0).animate({opacity:1}); } } }).bind("mouseleave", function(){ dropdowns.stop().hide(); }); }); if (options.fancy) { var fancyoptions = $.extend({ mode: 'move', transition: 'easeOutExpo', duration: 500, onEnter: null, onLeave: null }, options.fancy) var fancy = ele.append('