Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JQuery show属性不工作-prestashop_Jquery_Ajax_Twitter Bootstrap_Css_Prestashop - Fatal编程技术网

JQuery show属性不工作-prestashop

JQuery show属性不工作-prestashop,jquery,ajax,twitter-bootstrap,css,prestashop,Jquery,Ajax,Twitter Bootstrap,Css,Prestashop,我使用prestashop 1.6.x.x和BlockLayed导航模块在我的类别列表页面上过滤结果,我想在过滤结果时隐藏类别描述 我已经添加了这段代码,它隐藏了类别描述,但当我取消选中时,它不会显示类别描述回来 $(document).ready(function () { $('.checkbox').on('change', function () { $("#categorydesc").toggle(500); }); }); 这是模块的代码 var ajaxQueries = ne

我使用prestashop 1.6.x.x和BlockLayed导航模块在我的类别列表页面上过滤结果,我想在过滤结果时隐藏类别描述

我已经添加了这段代码,它隐藏了类别描述,但当我取消选中时,它不会显示类别描述回来

$(document).ready(function () {
$('.checkbox').on('change', function () {
$("#categorydesc").toggle(500);
});
});
这是模块的代码

var ajaxQueries = new Array();
var ajaxLoaderOn = 0;
var sliderList = new Array();
var slidersInit = false;

$(document).ready(function()
{
cancelFilter();
openCloseFilter();

// Click on color
$(document).on('click', '#layered_form input[type=button], #layered_form label.layered_color', function(e) {
if (!$('input[name='+$(this).attr('name')+'][type=hidden]').length)
$('<input />').attr('type', 'hidden').attr('name', $(this).attr('name')).val($(this).data('rel')).appendTo('#layered_form');
else
$('input[name='+$(this).attr('name')+'][type=hidden]').remove();
reloadContent(true);
});

$(document).on('click', '#layered_form input[type=checkbox], #layered_form input[type=radio]', function() {
reloadContent(true);
});

// Doesn't work with document element
$('body').on('change', '#layered_form .select', function() {
reloadContent(true);
});

// Changing content of an input text
$(document).on('keyup', '#layered_form input.layered_input_range', function(e){
if ($(this).attr('timeout_id'))
window.clearTimeout($(this).attr('timeout_id'));

// IE Hack, setTimeout do not acept the third parameter
var reference = this;

$(this).attr('timeout_id', window.setTimeout(function(it){
if (!$(it).attr('id'))
it = reference;

var filter = $(it).attr('id').replace(/^layered_(.+)_range_.*$/, '$1');

var value_min = parseInt($('#layered_'+filter+'_range_min').val());
if (isNaN(value_min))
value_min = 0;
$('#layered_'+filter+'_range_min').val(value_min);

var value_max = parseInt($('#layered_'+filter+'_range_max').val());
if (isNaN(value_max))
value_max = 0;
$('#layered_'+filter+'_range_max').val(value_max);

if (value_max < value_min) {
$('#layered_'+filter+'_range_max').val($(it).val());
$('#layered_'+filter+'_range_min').val($(it).val());
}
reloadContent();
}, 500, this));
});

$(document).on('click', '#layered_block_left .radio', function(e){
var name = $(this).attr('name');
$.each($(this).parent().parent().find('input[type=button]'), function (it, item) {
if ($(item).hasClass('on') && $(item).attr('name') != name)
$(item).click();
});
return true;
});

// Click on label
$(document).on('click', '#layered_block_left label:not(.layered_color) a', function(e) {
e.preventDefault();
var disable = $(this).parent().parent().find('input').attr('disabled');
if (disable == '' || typeof(disable) == 'undefined' || disable == false)
{
$(this).parent().parent().find('input').click();
}
});

layered_hidden_list = {};
$('.hide-action').on('click', function(e){
if (typeof(layered_hidden_list[$(this).parent().find('ul').attr('id')]) == 'undefined' || layered_hidden_list[$(this).parent().find('ul').attr('id')] == false)
layered_hidden_list[$(this).parent().find('ul').attr('id')] = true;
else
layered_hidden_list[$(this).parent().find('ul').attr('id')] = false;
hideFilterValueAction(this);
});
$('.hide-action').each(function() {
hideFilterValueAction(this);
});

$(document).off('change', '.selectProductSort').on('change', '.selectProductSort', function(e) {
$('.selectProductSort').val($(this).val());

if($('#layered_form').length > 0)
reloadContent('forceSlide');
});

$(document).off('change', 'select[name="n"]').on('change', 'select[name="n"]', function(e)
{
$('select[name=n]').val($(this).val());
reloadContent('forceSlide');
});

paginationButton(false);
initLayered();
});

function initFilters()
{
if (typeof filters !== 'undefined')
{
for (key in filters)
{
if (filters.hasOwnProperty(key))
var filter = filters[key];

if (typeof filter.slider !== 'undefined' && parseInt(filter.filter_type) == 0)
{
var filterRange = parseInt(filter.max)-parseInt(filter.min);
var step = filterRange / 100;

if (step > 1)
    step = parseInt(step);

addSlider(filter.type,
{
    range: true,
    step: step,
    min: parseInt(filter.min),
    max: parseInt(filter.max),
    values: [filter.values[0], filter.values[1]],
    slide: function(event, ui) {
        stopAjaxQuery();

        if (parseInt($(event.target).data('format')) < 5)
        {
            from = formatCurrency(ui.values[0], parseInt($(event.target).data('format')),
                $(event.target).data('unit'));
            to = formatCurrency(ui.values[1], parseInt($(event.target).data('format')),
                $(event.target).data('unit'));
        }
        else
        {
            from = ui.values[0] + $(event.target).data('unit');
            to = ui.values[1] + $(event.target).data('unit');
        }

        $('#layered_' + $(event.target).data('type') + '_range').html(from + ' - ' + to);
    },
    stop: function () {
        reloadContent(true);
    }
}, filter.unit, parseInt(filter.format));
}
else if(typeof filter.slider !== 'undefined' && parseInt(filter.filter_type) == 1)
{
$('#layered_' + filter.type + '_range_min').attr('limitValue', filter.min);
$('#layered_' + filter.type + '_range_max').attr('limitValue', filter.max);
}

$('.layered_' + filter.type).show();
}
initUniform();
}
}

function initUniform()
{
//  if (!!$.prototype.uniform)
//      $("#layered_form input[type='checkbox'], #layered_form input[type='radio'], select.form-control").uniform();
}

function hideFilterValueAction(it)
{
if (typeof(layered_hidden_list[$(it).parent().find('ul').attr('id')]) == 'undefined'
|| layered_hidden_list[$(it).parent().find('ul').attr('id')] == false)
{
$(it).parent().find('.hiddable').hide();
$(it).parent().find('.hide-action.less').hide();
$(it).parent().find('.hide-action.more').show();
}
else
{
$(it).parent().find('.hiddable').show();
$(it).parent().find('.hide-action.less').show();
$(it).parent().find('.hide-action.more').hide();
}
}

function addSlider(type, data, unit, format)
{
sliderList.push({
type: type,
data: data,
unit: unit,
format: format
});
}

function initSliders()
{
$(sliderList).each(function(i, slider){
$('#layered_'+slider['type']+'_slider').slider(slider['data']);

var from = '';
var to = '';
switch (slider['format'])
{
case 1:
case 2:
case 3:
case 4:
from = formatCurrency($('#layered_'+slider['type']+'_slider').slider('values', 0), slider['format'], slider['unit']);
to = formatCurrency($('#layered_'+slider['type']+'_slider').slider('values', 1), slider['format'], slider['unit']);
break;
case 5:
from =  $('#layered_'+slider['type']+'_slider').slider('values', 0)+slider['unit']
to = $('#layered_'+slider['type']+'_slider').slider('values', 1)+slider['unit'];
break;
}
$('#layered_'+slider['type']+'_range').html(from+' - '+to);
});
}

function initLayered()
{
initFilters();
initSliders();
initLocationChange();
updateProductUrl();
if (window.location.href.split('#').length == 2 && window.location.href.split('#')[1] != '')
{
var params = window.location.href.split('#')[1];
reloadContent('&selected_filters='+params);
}
}

function paginationButton(nbProductsIn, nbProductOut)
{
if (typeof(current_friendly_url) === 'undefined')
current_friendly_url = '#';

$('div.pagination a').not(':hidden').each(function () {

if ($(this).attr('href').search(/(\?|&)p=/) == -1)
var page = 1;
else
var page = parseInt($(this).attr('href').replace(/^.*(\?|&)p=(\d+).*$/, '$2'));

var location = window.location.href.replace(/#.*$/, '');
$(this).attr('href', location + current_friendly_url.replace(/\/page-(\d+)/, '') + '/page-' + page);
});

$('div.pagination li').not('.current, .disabled').each(function () {
var nbPage = 0;
if ($(this).hasClass('pagination_next'))
nbPage = parseInt($('div.pagination li.current').children().children().html())+ 1;
else if ($(this).hasClass('pagination_previous'))
nbPage = parseInt($('div.pagination li.current').children().children().html())- 1;

$(this).children().children().on('click', function(e)
{
e.preventDefault();
if (nbPage == 0)
p = parseInt($(this).html()) + parseInt(nbPage);
else
p = nbPage;
p = '&p='+ p;
reloadContent(p);
nbPage = 0;
});
});

//product count refresh
if(nbProductsIn!=false)
{
if(isNaN(nbProductsIn) == 0)
{
// add variables
var productCountRow = $('.product-count').html();
var nbPage = parseInt($('div.pagination li.current').children().children().html());
var nb_products = nbProductsIn;

if ($('#nb_item option:selected').length == 0)
var nbPerPage = nb_products;
else
var nbPerPage = parseInt($('#nb_item option:selected').val());

isNaN(nbPage) ? nbPage = 1 : nbPage = nbPage;
nbPerPage*nbPage < nb_products ? productShowing = nbPerPage*nbPage :productShowing = (nbPerPage*nbPage-nb_products-nbPerPage*nbPage)*-1;
nbPage==1 ? productShowingStart=1 : productShowingStart=nbPerPage*nbPage-nbPerPage+1;


//insert values into a .product-count
productCountRow = $.trim(productCountRow);
productCountRow = productCountRow.split(' ');

var backStart = new Array;
for (row in productCountRow)
if (parseInt(productCountRow[row]) + 0 == parseInt(productCountRow[row]))
    backStart.push(row);

if (typeof backStart[0] !== 'undefined')
productCountRow[backStart[0]] = productShowingStart;
if (typeof backStart[1] !== 'undefined')
productCountRow[backStart[1]] = (nbProductOut != 'undefined') && (nbProductOut > productShowing) ? nbProductOut : productShowing;
if (typeof backStart[2] !== 'undefined')
productCountRow[backStart[2]] = nb_products;

if (typeof backStart[1] !== 'undefined' && typeof backStart[2] !== 'undefined' && productCountRow[backStart[1]] > productCountRow[backStart[2]])
productCountRow[backStart[1]] = productCountRow[backStart[2]];

productCountRow = productCountRow.join(' ');
$('.product-count').html(productCountRow);
$('.product-count').show();
}
else
$('.product-count').hide();
}
}

function cancelFilter()
{
$(document).on('click', '#enabled_filters a', function(e){
if ($(this).data('rel').search(/_slider$/) > 0)
{
if ($('#'+$(this).data('rel')).length)
{
$('#'+$(this).data('rel')).slider('values' , 0, $('#'+$(this).data('rel')).slider('option' , 'min' ));
$('#'+$(this).data('rel')).slider('values' , 1, $('#'+$(this).data('rel')).slider('option' , 'max' ));
$('#'+$(this).data('rel')).slider('option', 'slide')(0,{values:[$('#'+$(this).data('rel')).slider( 'option' , 'min' ), $('#'+$(this).data('rel')).slider( 'option' , 'max' )]});
}
else if($('#'+$(this).data('rel').replace(/_slider$/, '_range_min')).length)
{
$('#'+$(this).data('rel').replace(/_slider$/, '_range_min')).val($('#'+$(this).data('rel').replace(/_slider$/, '_range_min')).attr('limitValue'));
$('#'+$(this).data('rel').replace(/_slider$/, '_range_max')).val($('#'+$(this).data('rel').replace(/_slider$/, '_range_max')).attr('limitValue'));
}
}
else
{
if ($('option#'+$(this).data('rel')).length)
$('#'+$(this).data('rel')).parent().val('');
else
{
$('#'+$(this).data('rel')).attr('checked', false);
$('.'+$(this).data('rel')).attr('checked', false);
$('#layered_form input[type=hidden][name='+$(this).data('rel')+']').remove();
}
}
reloadContent(true);
e.preventDefault();
});
}

function openCloseFilter()
{
$(document).on('click', '#layered_form span.layered_close a', function(e)
{
if ($(this).html() == '&lt;')
{
$('#'+$(this).data('rel')).show();
$(this).html('v');
$(this).parent().removeClass('closed');

}
else
{
$('#'+$(this).data('rel')).hide();
$(this).html('&lt;');
$(this).parent().addClass('closed');
}

e.preventDefault();
});
}

function stopAjaxQuery() {
if (typeof(ajaxQueries) == 'undefined')
ajaxQueries = new Array();
for(i = 0; i < ajaxQueries.length; i++)
ajaxQueries[i].abort();
ajaxQueries = new Array();
}

function reloadContent(params_plus)
{
stopAjaxQuery();

if (!ajaxLoaderOn)
{
$('.product_list').prepend($('#layered_ajax_loader').html());
$('.product_list').css('opacity', '0.7');
ajaxLoaderOn = 1;
}

data = $('#layered_form').serialize();
$('.layered_slider').each( function () {
var sliderStart = $(this).slider('values', 0);
var sliderStop = $(this).slider('values', 1);
if (typeof(sliderStart) == 'number' && typeof(sliderStop) == 'number')
data += '&'+$(this).attr('id')+'='+sliderStart+'_'+sliderStop;
});

$(['price', 'weight']).each(function(it, sliderType)
{
if ($('#layered_'+sliderType+'_range_min').length)
data += '&layered_'+sliderType+'_slider='+$('#layered_'+sliderType+'_range_min').val()+'_'+$('#layered_'+sliderType+'_range_max').val();
});

$('#layered_form .select option').each( function () {
if($(this).attr('id') && $(this).parent().val() == $(this).val())
data += '&'+$(this).attr('id') + '=' + $(this).val();
});

if ($('.selectProductSort').length && $('.selectProductSort').val())
{
if ($('.selectProductSort').val().search(/orderby=/) > 0)
{
// Old ordering working
var splitData = [
$('.selectProductSort').val().match(/orderby=(\w*)/)[1],
$('.selectProductSort').val().match(/orderway=(\w*)/)[1]
];
}
else
{
// New working for default theme 1.4 and theme 1.5
var splitData = $('.selectProductSort').val().split(':');
}
data += '&orderby='+splitData[0]+'&orderway='+splitData[1];
}
if ($('select[name=n]:first').length)
{
if (params_plus)
data += '&n=' + $('select[name=n]:first').val();
else
data += '&n=' + $('div.pagination form.showall').find('input[name=n]').val();
}

var slideUp = true;
if (typeof params_plus === 'undefined' || !(typeof params_plus === 'string'))
{
params_plus = '';
slideUp = false;
}

// Get nb items per page
var n = '';
if (params_plus)
{
$('div.pagination select[name=n]').children().each(function(it, option) {
if (option.selected)
n = '&n=' + option.value;
});
}
//DONGND:: fix sort not correct at category page
var data_send = '';
if(params_plus == 'forceSlide')
{
data_send = data+n;
}
else
{
data_send = data+params_plus+n;
}

ajaxQuery = $.ajax(
{
type: 'GET',
url: baseDir + 'modules/blocklayered/blocklayered-ajax.php',
//DONGND:: fix sort not correct at category page
data: data_send,
// data: data+n,
dataType: 'json',
cache: false, // @todo see a way to use cache and to add a timestamps parameter to refresh cache each 10 minutes for example
success: function(result)
{
if (typeof(result) === 'undefined')
return;

if (result.meta_description != '')
$('meta[name="description"]').attr('content', result.meta_description);

if (result.meta_keywords != '')
$('meta[name="keywords"]').attr('content', result.meta_keywords);

if (result.meta_title != '')
$('title').html(result.meta_title);

if (result.heading != '')
$('h1.page-heading .cat-name').html(result.heading);

$('#layered_block_left').replaceWith(utf8_decode(result.filtersBlock));
$('.category-product-count, .heading-counter').html(result.categoryCount);

if (result.nbRenderedProducts == result.nbAskedProducts)
$('div.clearfix.selector1').hide();

if (result.productList)
$('.product_list').replaceWith(utf8_decode(result.productList));
else
$('.product_list').html('');

$('.product_list').css('opacity', '1');
if ($.browser.msie) // Fix bug with IE8 and aliasing
$('.product_list').css('filter', '');

if (result.pagination.search(/[^\s]/) >= 0)
{
var pagination = $('<div/>').html(result.pagination)
var pagination_bottom = $('<div/>').html(result.pagination_bottom);

if ($('<div/>').html(pagination).find('#pagination').length)
{
    $('#pagination').show();
    $('#pagination').replaceWith(pagination.find('#pagination'));
}
else
    $('#pagination').hide();

if ($('<div/>').html(pagination_bottom).find('#pagination_bottom').length)
{
    $('#pagination_bottom').show();
    $('#pagination_bottom').replaceWith(pagination_bottom.find('#pagination_bottom'));
}
else
    $('#pagination_bottom').hide();
}
else
{
$('#pagination').hide();
$('#pagination_bottom').hide();
}

paginationButton(result.nbRenderedProducts, result.nbAskedProducts);
ajaxLoaderOn = 0;

// On submiting nb items form, relaod with the good nb of items
$('div.pagination form').on('submit', function(e)
{
e.preventDefault();
val = $('div.pagination select[name=n]').val();

$('div.pagination select[name=n]').children().each(function(it, option) {
    if (option.value == val)
        $(option).attr('selected', true);
    else
        $(option).removeAttr('selected');
});

// Reload products and pagination
reloadContent();
});
if (typeof(ajaxCart) != "undefined")
ajaxCart.overrideButtonsInThePage();

if (typeof(reloadProductComparison) == 'function')
reloadProductComparison();

filters = result.filters;
initFilters();
initSliders();

current_friendly_url = result.current_friendly_url;

// Currente page url
if (typeof(current_friendly_url) === 'undefined')
current_friendly_url = '#';

// Get all sliders value
$(['price', 'weight']).each(function(it, sliderType)
{
if ($('#layered_'+sliderType+'_slider').length)
{
    // Check if slider is enable & if slider is used
    if (typeof($('#layered_'+sliderType+'_slider').slider('values', 0)) != 'object')
    {
        if ($('#layered_'+sliderType+'_slider').slider('values', 0) != $('#layered_'+sliderType+'_slider').slider('option' , 'min')
        || $('#layered_'+sliderType+'_slider').slider('values', 1) != $('#layered_'+sliderType+'_slider').slider('option' , 'max'))
            current_friendly_url += '/'+blocklayeredSliderName[sliderType]+'-'+$('#layered_'+sliderType+'_slider').slider('values', 0)+'-'+$('#layered_'+sliderType+'_slider').slider('values', 1)
    }
}
else if ($('#layered_'+sliderType+'_range_min').length)
    current_friendly_url += '/'+blocklayeredSliderName[sliderType]+'-'+$('#layered_'+sliderType+'_range_min').val()+'-'+$('#layered_'+sliderType+'_range_max').val();
});

window.location.href = current_friendly_url;

if (current_friendly_url != '#/show-all')
$('div.clearfix.selector1').show();

lockLocationChecking = true;

if (slideUp)
$.scrollTo('.product_list', 400);
updateProductUrl();

$('.hide-action').each(function() {
hideFilterValueAction(this);
});

if (display instanceof Function) {
var view = $.totalStorage('display');

if (view && view != 'grid')
    display(view);
}

if (typeof leoOption !== 'undefined') {
var leoCustomAjax = new $.LeoCustomAjax();
leoCustomAjax.processAjax();
}
}
});
ajaxQueries.push(ajaxQuery);
}

function initLocationChange(func, time)
{
if (!time)
time = 500;
var current_friendly_url = getUrlParams();
setInterval(function()
{
if(getUrlParams() != current_friendly_url && !lockLocationChecking)
{
// Don't reload page if current_friendly_url and real url match
if (current_friendly_url.replace(/^#(\/)?/, '') == getUrlParams().replace(/^#(\/)?/, ''))
return;

lockLocationChecking = true;
reloadContent('&selected_filters='+getUrlParams().replace(/^#/, ''));
}
else
{
lockLocationChecking = false;
current_friendly_url = getUrlParams();
}
}, time);
}

function getUrlParams()
{
if (typeof(current_friendly_url) === 'undefined')
current_friendly_url = '#';

var params = current_friendly_url;
if(window.location.href.split('#').length == 2 && window.location.href.split('#')[1] != '')
params = '#'+window.location.href.split('#')[1];
return params;
}

function updateProductUrl()
{
// Adding the filters to URL product
if (typeof(param_product_url) != 'undefined' && param_product_url != '' && param_product_url !='#') {
$.each($('ul.product_list li.ajax_block_product .product_img_link,'+
'ul.product_list li.ajax_block_product h5 a,'+
'ul.product_list li.ajax_block_product .product_desc a,'+
'ul.product_list li.ajax_block_product .lnk_view'), function() {
$(this).attr('href', $(this).attr('href') + param_product_url);
});
}
}

/**
* Copy of the php function utf8_decode()
*/
function utf8_decode (utfstr)
{
var res = '';
for (var i = 0; i < utfstr.length;) {
var c = utfstr.charCodeAt(i);

if (c < 128)
{
res += String.fromCharCode(c);
i++;
}
else if((c > 191) && (c < 224))
{
var c1 = utfstr.charCodeAt(i+1);
res += String.fromCharCode(((c & 31) << 6) | (c1 & 63));
i += 2;
}
else
{
var c1 = utfstr.charCodeAt(i+1);
var c2 = utfstr.charCodeAt(i+2);
res += String.fromCharCode(((c & 15) << 12) | ((c1 & 63) << 6) | (c2 & 63));
i += 3;
}
}
return res;
}
var ajaxquerys=new Array();
var ajaxLoaderOn=0;
var sliderList=新数组();
var slidersInit=false;
$(文档).ready(函数()
{
取消过滤器();
openCloseFilter();
//点击颜色
$(文档)。在('单击','分层表单输入[type=button],'分层表单标签上。分层表单颜色',函数(e){
if(!$('input[name='+$(this).attr('name')+'][type=hidden]').length)
$('').attr('type','hidden').attr('name',$(this.attr('name')).val($(this.data('rel')).appendTo('layered#form');
其他的
$('input[name='+$(this.attr('name')+'][type=hidden]').remove();
重新加载内容(true);
});
$(文档)。在('click'、'#layered#form input[type=checkbox]、#layered#form input[type=radio]”上,函数(){
重新加载内容(true);
});
//不适用于文档元素
$('body').on('change','layered#u form.select',function(){
重新加载内容(true);
});
//更改输入文本的内容
$(文档).on('keyup','layered#u form input.layered_input_range',函数(e){
if($(this.attr('timeout\u id'))
clearTimeout($(this.attr('timeout\u id'));
//IE Hack,setTimeout不接受第三个参数
var reference=此;
$(this.attr('timeout\u id',window.setTimeout(function)(it){
if(!$(it).attr('id'))
它=参考;
var filter=$(it).attr('id').replace(/^layered.++)u range.*$/,'1');
var value_min=parseInt($('layered_'+filter+'u range_min').val());
如果(isNaN(值\最小值))
值_min=0;
$(“#分层"+过滤器+”"范围"最小值“).val(值"最小值);
var value_max=parseInt($('layered_'+filter+'u range_max').val());
如果(isNaN(最大值))
值_max=0;
$(“#分层"+过滤器+”"范围"最大值“).val(值"最大值);
如果(最大值<最小值){
$('#layered'+filter+''u range_max').val($(it.val());
$('#layered'+filter+''u range_min').val($(it.val());
}
重新加载内容();
}500,这个),;
});
$(文档).on('click','layered#block_left.radio',函数(e){
var name=$(this.attr('name');
$.each($(this.parent().parent().find('input[type=button])、函数(it、项){
if($(item).hasClass('on')&&($(item).attr('name')!=name)
$(项)。单击();
});
返回true;
});
//点击标签
$(文档).on('click','#layered_block_左标签:not(.layered_color)a',函数(e){
e、 预防默认值();
var disable=$(this.parent().parent().find('input').attr('disabled');
if(disable=''|| typeof(disable)=='undefined'|| disable==false)
{
$(this).parent().parent().find('input')。click();
}
});
分层_隐藏_列表={};
$('hide action')。在('click',函数(e)上{
if(typeof(layered_hidden_list[$(this).parent().find('ul').attr('id')])=='undefined'| | layered_hidden_list[$(this).parent().find('ul').attr('id')]==false)
分层隐藏列表[$(this).parent().find('ul').attr('id')]=true;
其他的
分层隐藏列表[$(this).parent().find('ul').attr('id')]=false;
hideFilterValueAction(此);
});
$('.hide action')。每个(函数(){
hideFilterValueAction(此);
});
$(document).off('change','selectProductSort')。on('change','selectProductSort',函数(e){
$('.selectProductSort').val($(this.val());
如果($('#分层形式')。长度>0)
重新加载内容(“强制幻灯片”);
});
$(文档).off('change','select[name=“n”]')。on('change','select[name=“n”]”),函数(e)
{
$('select[name=n]').val($(this.val());
重新加载内容(“强制幻灯片”);
});
分页按钮(假);
initLayered();
});
函数initFilters()
{
if(过滤器类型!==“未定义”)
{
用于(输入过滤器)
{
if(filters.hasOwnProperty(key))
变量过滤器=过滤器[键];
if(type of filter.slider!='undefined'&&parseInt(filter.filter\u type)==0)
{
var filterge=parseInt(filter.max)-parseInt(filter.min);
var步骤=过滤/100;
如果(步骤>1)
步骤=parseInt(步骤);
添加滑块(filter.type,
{
范围:对,
步骤:步骤,
min:parseInt(filter.min),
max:parseInt(filter.max),
值:[filter.values[0],filter.values[1]],
幻灯片:功能(事件、用户界面){
stopAjaxQuery();
if(parseInt($(event.target).data('format'))<5)
{
from=formatCurrency(ui.values[0],parseInt($(event.target).data('format')),
$(event.target).data('unit');
to=formatCurrency(ui.values[1],parseInt($(event.target).data('format')),
$(event.target).data('unit');
}
其他的
{
from=ui.values[0]+$(event.target.data('unit');
to=ui.values[1]+$(event.target.data('unit');
}
$('#layered'+$(event.target).data('type')++''u range').html(从+'-'+to);
},
停止:函数(){
重新加载内容(true);
}
},filter.unit,parseInt(filter.format));
}
else if(type of filter.slider!='undefined'&&parseInt(filter.filter\u type)==1)
{
$('layered'filter.type+'u range'u min').attr('limitValue',filter.min);
$('layered'filter.type+'u range'u max').attr('limitValue',filter.max);
}
$('.layered.'+filter.type).show();
}
initUniform();
}
}
函数initUniform()
{
//如果(!!$.prototype.uniform)
//$(“#分层表单输入[type='checkbox'],#分层表单输入[type='radio'],选择.form控件”).uniform();
}
函数hideFilterValueAction(it)
{
if(typeof(layered_hidden_list[$(it).parent().find('ul').attr('id')])=='undefined'
||分层隐藏列表[$(it).parent().find('ul').attr('id')]==false)
{
$(it.parent().find('.hiddable').hide();
$(it.parent().find('.hide action.less').hide();
$(it.parent().find('.hide action.more').show();
}
其他的
{
$(it).parent().find('.hiddable').show();
$(it.parent().find('.hide action.less').show();
$(it).parent().find('.hide action.more').hide();
}
}
函数addSlider(类型、数据、单位、格式)
$('#').bind("DOMSubtreeModified",function(){
    if ($('#enabled_filters').length) {
       $("#categorydesc").hide();
    } else {        
       $("#categorydesc").show();
    }
});
$('.product_list').bind("DOMSubtreeModified",function(){
        if ($('#enabled_filters').length) {
           $("#categorydesc").hide();
        } else {        
           $("#categorydesc").show();
        }
    });