var pStatus = 0; jQuery(document).ready(function() { $("#popupWarenkorbBackground").click(function(){ $('#popupWarenkorbBackground').fadeOut("slow"); $('#popupWarenkorb').fadeOut("slow"); $('#popupWarenkorbBackground').remove(); $('#popupWarenkorb').remove(); pStatus = 0; return false; }); $(".toProduct").click(function(){ $('#popupWarenkorbBackground').fadeOut("slow"); $('#popupWarenkorb').fadeOut("slow"); $('#popupWarenkorbBackground').remove(); $('#popupWarenkorb').remove(); pStatus = 0; return false; }); }); function send(formular) { var data = $(formular).serialize(); var ts = Math.round((new Date()).getTime() / 1000); $('.vorschauloader').fadeIn('slow'); $.ajax({ type: 'POST', dataType: 'json', async: false, url: 'index.php?ajax=true&'+data+'&page=ajaxcart&c='+ts+'&xc4ce2=ff0c0b7274100562210aa446f04c6768&info=', data: data, success: function(datas){ $('#slidingBasketContent').html(datas.data); if(datas.count > 0){ $('#slidingTopTrigger .pixcartmini').html('Warenkorb ' + datas.count + ' Produkte'); } $.ajax({ type: "GET", dataType: 'html', url: "index.php?ajax=true&"+data.replace('action=add_product&', '')+"&page=ajaxgocart&c='+ts+'&xc4ce2=ff0c0b7274100562210aa446f04c6768", success: function(cartdatas){ $(cartdatas).prependTo('body'); $('#popupWarenkorb').css({ position: 'fixed', left: '50%', top: '-' + ((jQuery(window).height()/2)+$('#popupWarenkorb').outerHeight())+'px', }).css({ marginLeft: '-' + ($('#popupWarenkorb').outerWidth() / 2) + 'px' }); if(pStatus == 0) { $("#popupWarenkorbBackground").css({"opacity": "0.9"}); $("#popupWarenkorbBackground").fadeIn("slow"); $('#popupWarenkorb').fadeIn("slow").animate({"top": ((jQuery(window).height()/2)-$('#popupWarenkorb').outerHeight())+"px"}, "slow"); pStatus = 1; $('.vorschauloader').fadeOut('slow'); } return false; } }); return false; } }); return false; }