1.2(44 kW ; 10/2007 - 11/2014) 1.2 12V(44 kW ; 11/2011 - 12/2014)
//= tabOperator.threshold;
//Activate tabs or accordion
if (previousAboveThreshold)
{
//If above threshold - activate tabs
tabOperator.initTabs();
}
else
{
//If below threshold - activate accordion
tabOperator.initAccordion(tabOperator.initialAccIndex);
}
//On tab click
tabOperator.hookToAccordionOnClick();
//On window resize
$(window).on('themeResize', function (e, resizeEvent) {
if ($(window).width() < tabOperator.threshold)
{
if (previousAboveThreshold)
{
//Now below threshold, previously above, so switch to accordion
var api = tabOperator.$tabsContainer.data("tabs");
var index = api.getIndex();
api.destroy();
tabOperator.initAccordion(index);
}
previousAboveThreshold = false;
}
else
{
if (!previousAboveThreshold)
{
//Now above threshold, previously below, so switch to tabs
var api = tabOperator.$panelsContainer.data("tabs");
var index = api.getIndex();
api.destroy();
tabOperator.$rootContainer.removeClass("accor");
tabOperator.initTabs(index);
}
previousAboveThreshold = true;
}
});
}
else if (tabOperator.mode === 2)
{
tabOperator.initAccordion(tabOperator.initialAccIndex);
//On tab click
tabOperator.hookToAccordionOnClick();
}
else
{
tabOperator.initTabs();
}
} //end: init
, initTabs : function(index)
{
//If no param, set it to 0
if (typeof index === "undefined")
{
index = 0;
}
tabOperator.$tabsContainer.tabs(".tabs-panels .panel", {effect: tabOperator.tabEffect, initialIndex: index});
}
, initAccordion : function(index)
{
//If no param, set it to 0
if (typeof index === "undefined")
{
index = 0;
}
tabOperator.$rootContainer.addClass("accor");
tabOperator.$panelsContainer.tabs(".tabs-panels .panel", {tabs: '.acctab', effect: tabOperator.accEffect, initialIndex: index});
}
, hookToAccordionOnClick : function()
{
//Attach a handler to an event after a tab is clicked
tabOperator.$panelsContainer.bind("onClick", function(event, index) {
//Note: "this" is a reference to the DOM element of tabs
//var theTabs = this;
var target = event.target || event.srcElement || event.originalTarget;
//If viewport is lower than the item, scroll to that item
var itemOffsetTop = $(target).offset().top;
var viewportOffsetTop = jQuery(window).scrollTop();
if (itemOffsetTop < viewportOffsetTop)
{
$("html, body").delay(150).animate({scrollTop: (itemOffsetTop-50)}, 600, 'easeOutCubic');
}
}); //end: bind onClick
}
, openTab : function()
{
if (tabOperator.$rootContainer.hasClass("accor"))
{
var $panels = tabOperator.$panelsContainer;
var indexOfTab = $panels.children(".acctab").index($("#acctab-tabreviews"));
$panels.data("tabs").click(indexOfTab);
}
else
{
var $tabs = tabOperator.$tabsContainer;
var indexOfTab = $tabs.children("#tab-tabreviews").index();
$tabs.data("tabs").click(indexOfTab);
}
}
, slideTo : function(target, offset)
{
//Slide to tab (minus height of sticky menu)
var itemOffsetTop = $(target).offset().top - offset;
$("html, body").animate({scrollTop: itemOffsetTop}, 600, 'easeOutCubic');
}
};
//Initialize tabs
tabOperator.init('#product-tabs');
$("#goto-reviews").click(function() {
tabOperator.openTab();
tabOperator.slideTo('#product-tabs', 50);
}); //end: on click
$("#goto-reviews-form").click(function() {
tabOperator.openTab();
tabOperator.slideTo('#review-form', 90);
}); //end: on click
});
//]]>
Diese Website benötigt Cookies, um alle Funktionen bereitzustellen. Weitere Informationen darüber, welche Daten in den Cookies enthalten sind, finden Sie auf unserer Datenschutzrichtlinie. Um Cookies von dieser Seite zu akzeptieren, klicken Sie bitte unten auf die Schaltfläche Zulassen.