// JavaScript Document jQuery(document).ready(function(jQuery) { /** * navItemHoverBlock */ // jQuery('#mainmenu li span').each(function() { // jQuery(this).css('width', jQuery(this).width()); // jQuery(this).addClass('navItemHoverBlock'); // }); /* Aktive Navigationselemente */ if (!jQuery('ul.nav li').is('.current, .current-menu-item')) { var pathname = window.location.pathname; /* Magento / Produktkatalog */ if (pathname.indexOf('wordpress') == -1) { /* Produkte */ if ((pathname.length > 1) && (pathname.indexOf('catalogsearch') == -1) && (pathname.indexOf('support-level') == -1)) { jQuery('ul#mainmenu li.produkte').addClass('current'); } else { /* Artikelfinder */ if ((pathname.indexOf('catalogsearch') != -1) && (pathname.indexOf('advanced') != -1)) { jQuery('#applications li.artikelfinder').addClass('current'); jQuery('.breadcrumbs').removeClass('top'); } } } } /* Produkte (Kategotieübersicht) */ jQuery('.category-products ol > li').mouseenter(function(){ var small = jQuery(this).children('img:first'); var big = jQuery(this).children('a:first').clone(); big.css('position', 'absolute'); big.css('top', jQuery(this).offset().top + 'px'); big.css('left', jQuery(this).offset().left + 'px'); big.css('z-index', '1000'); small.css('visibility', 'hidden'); big.addClass('productshotZoom'); big.mouseleave(function(){ small.css('visibility', 'visible'); jQuery('.productshotZoom').remove(); }); jQuery('body').prepend(big); }); /* Produkte (Upselling) */ jQuery('.block-related ul > .related').mouseenter(function(){ var small = jQuery(this).children('img:first'); var big = jQuery(this).children('a:first').clone(); big.css('position', 'absolute'); big.css('top', jQuery(this).offset().top + 'px'); big.css('left', jQuery(this).offset().left + 'px'); big.css('z-index', '1000'); small.css('display', 'none'); big.addClass('productshotZoom'); big.mouseleave(function(){ small.css('display', 'block'); jQuery('.productshotZoom').remove(); }); jQuery('body').prepend(big); }); });