Есть код
jQuery(document).ready(function(){
var topControlIcon = jQuery ('.header #shop-basket, .page, body');
/*************************************************************** Sidebar Accordion *********************************************************************/
jQuery('.sidebar .block .block-title').append('<span class="toggle"></span>');
jQuery('.sidebar .block .block-title').on("click", function(){
if (jQuery(this).find('> span').attr('class') == 'toggle opened') { jQuery(this).find('> span').removeClass('opened').parents('.block').find('.block-content').slideToggle(); }
else {
jQuery(this).find('> span').addClass('opened').parents('.block').find('.block-content').slideToggle();
}
});
/**************************************************************** Footer Accordion *********************************************************************/
jQuery('.footer .footer-col > h4').append('<span class="toggle"></span>');
jQuery('.footer h4').on("click", function(){
if (jQuery(this).find('span').attr('class') == 'toggle opened') { jQuery(this).find('span').removeClass('opened').parents('.footer-col').find('.footer-col-content').slideToggle(); }
else {
jQuery(this).find('span').addClass('opened').parents('.footer-col').find('.footer-col-content').slideToggle();
}
});
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),
$flag
if(isMobile) {
jQuery('body').removeClass('ps-static');
jQuery('body').addClass('ps-phone');
jQuery('.page').click(function(){
jQuery('body').removeClass('ind');
swipe_animate_false();
});
};
var isiPhone = (navigator.userAgent.match(/iPhone/i) != null);
/* var isAct = jQuery('.cat-blocks .gTableSubTop');
if(isAct) {
jQuery('.cat-blocks .gTableTop').addClass("gggg");
}; */
jQuery(".searchForm .schQuery input").attr("maxlength", 120)
/********************************************************************** Header Cart *********************************************************************/
jQuery('.header #shop-basket').click(function(){
jQuery('.header-cart .cart-content').stop(true, true).slideToggle(300);
jQuery(this).toggleClass('active');
return false
});
jQuery(topControlIcon).not('.header #shop-basket').on('click',function(){
jQuery('.header #shop-basket .cart-content').slideUp();
jQuery('.header #shop-basket').removeClass('active');
});
});
/**********************************************************************back-top*****************************************************************************/
jQuery(function () {
jQuery(window).scroll(function () {
if (jQuery(this).scrollTop() > 100) {
jQuery('#back-top').fadeIn();
} else {
jQuery('#back-top').fadeOut();
}
});
// scroll body to 0px on click
jQuery('#back-top a').click(function () {
jQuery('body,html').stop(false, false).animate({
scrollTop: 0
}, 800);
return false;
});
});
/***************************************************************************************************** Magento class **************************************************************************/
jQuery(document).ready(function() {
jQuery('.sidebar .block').last().addClass('last_block');
jQuery('.sidebar .block').first().addClass('first');
jQuery('.product-view .product-img-box .product-image').append('<span></span>');
jQuery('.footer-cols-wrapper .footer-col').last().addClass('last');
jQuery(function() {
if(jQuery(".slider-sidebar").length){
jQuery('.slider-sidebar').carouFredSel({
responsive: true,
width: '100%',
prev: '.slider-sidebar-prev',
next: '.slider-sidebar-next',
pagination:'.slider-sidebar-pager',
scroll: 1,
auto : {
play : 1,
timeoutDuration :15000
},
items: {
visible: {
min: 1,
max: 1
},
width:270,
},
mousewheel: true,
swipe: {
onMouse: true,
onTouch: true
}
});
};
});
});
(function(doc) {
var addEvent = 'addEventListener',
type = 'gesturestart',
qsa = 'querySelectorAll',
scales = [1, 1],
meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];
function fix() {
meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];
doc.removeEventListener(type, fix, true);
}
if ((meta = meta[meta.length - 1]) && addEvent in doc) {
fix();
scales = [.25, 1.6];
doc[addEvent](type, fix, true);
}
}(document));
В html
<div class="header-cart">
<h3>Корзина:</h3>
<div class="block-content">
<?if($BODY$)?><div class="summary">$NUM_ENTRIES$ шт. - $ORDER_AMOUNT$</div><?endif?>
<div class="cart-content">
<div class="subtotal">
<?if($NUM_ENTRIES$)?>
<div class="total">Итого: <span class="price">$ORDER_AMOUNT$</span></div>
<?if($ORDER_DISCOUNT$)?>
<div class="disc"> Скидка: <span class="price-disc">$ORDER_DISCOUNT$</span></div>
<?if($DISCOUNT_INFO$)?>
<div class="disc-info"> $DISCOUNT_INFO$ </div>
<?endif?>
</div>
<?if($BODY$)?><ul>$BODY$</ul><?endif?>
<?endif?>
<div class="actions">
<a class="basketclear" href="javascript://" rel="nofollow" onclick="return clearBasket();">Очистить</a>
<a class="basketorder" href="/shop/checkout">Оформить заказ</a>
</div>
<?else?>
<div>Ваша корзина пуста</div>
</div>
<?endif?>
</div>
</div>
<?if($NUM_ENTRIES$)?> <?else?> <div class="empty">0 штук - <span class="price">$0.00</span></div><?endif?>
</div>
<script language="Javascript"><!--
var lock_buttons = 0;
function clearBasket(){
if(lock_buttons) return false; else lock_buttons = 1;
var el = $('#shop-basket');
if(el.length){ var g=document.createElement("div"); $(g).addClass('myWinGrid').attr("id",'shop-basket-fade').css({"left":"0","top":"0","position":"absolute","border":"#CCCCCC 1px solid","width":$(el).width()+'px',"height":$(el).height()+'px',"z-index":5}).hide().bind('mousedown',function(e){e.stopPropagation();e.preventDefault();_uWnd.globalmousedown();}).html('<div class="myWinLoad" style="margin:5px;"></div>'); $(el).append(g); $(g).show(); }
_uPostForm('',{type:'POST',url:'/shop/basket',data:{'mode':'clear'}});
return false;
}
function removeBasket(id){
if(lock_buttons) return false; else lock_buttons = 1;
$('#basket-item-'+id+' .sb-func').removeClass('remove').addClass('myWinLoadS').attr('title','');
_uPostForm('',{type:'POST',url:'/shop/basket',data:{'mode':'del', 'id':id}});
return false;
}
function add2Basket(id,pref){
if(lock_buttons) return false; else lock_buttons = 1;
var opt = new Array();
$('#b'+pref+'-'+id+'-basket').attr('disabled','disabled');
$('#'+pref+'-'+id+'-basket').removeClass('done').removeClass('err').removeClass('add').addClass('wait').attr('title','');
$('#'+pref+'-'+id+'-options-selectors').find('input:checked, select').each(function(){ opt.push(this.id.split('-')[3]+(parseInt(this.value) ? '-'+this.value :''));});
_uPostForm('',{type:'POST',url:'/shop/basket',data:{'mode':'add', 'id':id, 'pref':pref, 'opt':opt.join(':'), 'cnt':$('#q'+pref+'-'+id+'-basket').attr('value')}});
$.fancybox('#added-to-cart-message-alert', { type : 'inline', closeBtn : true, openEffect: 'fade', helpers: { overlay : null } } ); $('#basketplace').hide();
return false;
}
function buyNow(id,pref){
if(lock_buttons) return false; else lock_buttons = 1;
var opt = new Array();
$('#b'+pref+'-'+id+'-buynow').attr('disabled','disabled');
$('#'+pref+'-'+id+'-buynow').removeClass('done').removeClass('err').removeClass('now').addClass('wait').attr('title','');
$('#'+pref+'-'+id+'-options-selectors').find('input:checked, select').each(function(){ opt.push(this.id.split('-')[3]+(parseInt(this.value) ? '-'+this.value :''));});
_uPostForm('',{type:'POST',url:'/shop/basket',data:{'mode':'add', 'id':id, 'pref':pref, 'opt':opt.join(':'), 'cnt':$('#q'+pref+'-'+id+'-basket').attr('value'), 'now':1}});
return false;
}
//--></script>
Это аккардион. Если ссылка в html (Оформить заказ). При клике по ней не происходит перехода, а просто закрывается акардион. Помогите пожалуйста!