var pfad = window.location.origin + '/'; /*var tmpSrc;*/ var zuordnungkey = $('#z_key').val(); $('#topmenu a').removeClass('cur'); $('#z_'+zuordnungkey).addClass('cur'); var w = $( document ).width(); /*$.get( pfad+'shop/log_cookie.php?_='+($.now())+'&width='+w);*/ if(w >= 1000){ if(('ontouchstart' in document.documentElement)){ $('#topmenu a').on('click touchstart mouseover', function(e){ 'use strict'; if(!$(this).hasClass('cur_menu')){ e.preventDefault(); var key = $(this).attr('id').split('_')[1]; $('#topmenu a').removeClass('cur_menu'); $.get( pfad+'shop/menu.php?_='+($.now())+'&zuordnungkey='+key+'&width='+$( document ).width(), function( data ) { $('#z_'+key).addClass('cur_menu'); $('#menu').html(data).fadeIn(100); $('#back').show(); $('#back').on('touchstart mouseover', function(){ $('#back').hide(); $('#topmenu a').removeClass('cur_menu'); $('#menu').fadeOut(100).html(''); $('#topmenu').css('z-index', 'auto'); }); }); } }); }else{ $('#topmenu a').on('touchstart mouseover', function(){ 'use strict'; var key = $(this).attr('id').split('_')[1]; $('#topmenu a').removeClass('cur_menu'); $.get( pfad+'shop/menu.php?_='+($.now())+'&zuordnungkey='+key+'&width='+$( document ).width(), function( data ) { $('#z_'+key).addClass('cur_menu'); $('#menu').html(data).fadeIn(100); $('#back').show(); $('#back').on('touchstart mouseover', function(){ $('#back').hide(); $('#topmenu a').removeClass('cur_menu'); $('#menu').fadeOut(100).html(''); $('#topmenu').css('z-index', 'auto'); }); }); }); } }else{ $('#menu').on('click', function(){ 'use strict'; $('#sidebar').fadeIn(); }); $('#sidebar .close').on('click', function(){ 'use strict'; $('#sidebar').fadeOut(); }); $('#filterbtn').on('click', function(){ 'use strict'; $('#filter').fadeIn(); }); $('#filter .close').on('click', function(){ 'use strict'; $('#filter').fadeOut(); }); } $('#content_preview').on('touchend mouseleave', function(){ 'use strict'; $('#content_preview').css('display','none').html(''); $('#content_preview').html('').removeClass('preview'); }); $('#cookie div div').on('touchstart click', function(){ 'use strict'; $.get( pfad+'shop/session_unset.php?_='+($.now())+'&var=cookiewarn', function() { $('#cookie').fadeOut(); }); }); product(); landingpage(); fav_wk(); hotline(); footer(); function hotline(){ 'use strict'; $.get( pfad+'shop/shop_hotline.php?_='+($.now()), function( data ) { $('#hotline').html(data); $('#menu_wk').on('touchstart mouseover', function(){ cart_preview(); }); $('#btnsearch').on('click', function(){ var val=$('#search form input').val(); if(val.length>2){$('#search form').submit()} }); }); } function footer(){ 'use strict'; $.get( pfad+'shop/shop_footer.php?_='+($.now()), function( data ) { $('footer').html(data); }); } function product(){ $('#products .product').on('touchstart mouseover', function(){ 'use strict'; var produktkey = $(this).children().children('a.main').children('img').attr('class'); var main_src = $(this).children().children('a.main').children('img').attr('src'); var html = $(this).html(); var x = $(this).offset().left; var y = $(this).offset().top; var w = $(this).width(); $.get( pfad+'shop/content_preview.php?_='+($.now())+'&produktkey='+produktkey, function( data ) { $('#content_preview').css('display','none').html('
Diesen Artikel wirklich entfernen?
'); $('#dlg').fadeIn(); $('#cancel').on('click',function(){$('#dlg').fadeOut();}); $('#okay').on('click',function(){ $.get( pfad+'shop/favoriten.php?_='+($.now())+'&do=del&produktkey='+produktkey, function(){ location.reload(); }); }); }); } function cart_preview(){ 'use strict'; $.get( pfad+'shop/cart/preview.php?_='+($.now()), function( data ) { $('#cart_preview').html(data).removeClass('display_none'); setTimeout(function(){ $('#back').show(); $('#back').on('touchstart mouseover', function(){ $('#back').hide(); $('#cart_preview').html('').addClass('display_none'); });},2000); }); } /*Für Team Seite*/ $('.team img').on('touchstart', function(){ if($(this).css('opacity')=='0.2'){ $('.team img').css('opacity', '1'); }else{ $('.team img').css('opacity', '1'); $(this).css('opacity', '0.2'); } }); $('#cookie a.details').on('click', function(e){ $('div.detail').show(); e.preventDefault() });