jQuery(document).ready(function($){ $(".tt_tabs").bind("tabsbeforeactivate", function(event, ui){ $("html, body").animate({scrollTop: $("#"+$(ui.newTab).children("a").attr("id")).offset().top}, 400); }); $(".tt_tabs").on("tabsactivate", function(event, ui){ ui.newPanel.find(".image_carousel").trigger('configuration', ['debug', false, true]); }); $(".tt_tabs").tabs({ event: 'change', show: true, create: function(){ $("html, body").scrollTop(0); } }); //browser history $(".tt_tabs .ui-tabs-nav a").click(function(){ if($(this).attr("href").substr(0,4)!="http") $.bbq.pushState($(this).attr("href")); else window.location.href = $(this).attr("href"); }); $(".ui-accordion .ui-accordion-header").click(function(){ $.bbq.pushState("#" + $(this).attr("id").replace("accordion-", "")); }); //tabs box navigation $(".tabs_box_navigation").mouseover(function(){ $(this).find("ul").removeClass("tabs_box_navigation_hidden"); }); $(".tabs_box_navigation a").click(function(event){ if($.param.fragment()==$(this).attr("href").replace("#", "") || ($.param.fragment()=="" && $(this).attr("href").replace("#", "").substr(0, 10)=="all-events")) event.preventDefault(); $(".tabs_box_navigation_selected .selected").removeClass("selected"); $(this).parent().addClass("selected"); $(this).parent().parent().parent().children('label').text($(this).text()); $(this).parent().parent().addClass("tabs_box_navigation_hidden"); }); //hashchange $(window).bind("hashchange", function(event){ var hashSplit = $.param.fragment().split("-"); var hashString = ""; for(var i=0; i2 ? 3 : self.children().length), height: 'variable' }, scroll: { items: 1, easing: "swing", pauseOnHover: true }, prev: {button: self.next().children('#upcoming_event_prev')}, next: {button: self.next().children('#upcoming_event_next')}, auto: { play: (parseInt(autoscroll) ? true : false) } }); self.find("li a.tt_upcoming_events_event_container, li>span").hover(function(){ self.trigger('configuration', ['debug', false, true]); }, function(){ setTimeout(function(){ self.trigger('configuration', ['debug', false, true]); }, 1); }); }); $(window).resize(function(){ $(".tt_upcoming_events").trigger('configuration', ['debug', false, true]); }); //timetable row heights /*var maxHeight = Math.max.apply(null, $(".timetable:visible tr td:first-child").map(function () { return $(this).height(); }).get()); $(".timetable:visible tr td").css("height", maxHeight); //timetable height fix $(".timetable .event").each(function(){ if($(this).children(".event_container").length>1) { var childrenHeight = 0; $(this).children(".event_container").not(":last").each(function(){ childrenHeight += $(this).innerHeight(); }); var height = $(this).height()-childrenHeight-($(this).parent().parent().width()<=750 ? 9 : 22); if(height>$(this).children(".event_container").last().height()) $(this).children(".event_container").last().css("height", height + "px"); } });*/ });