我在购物车脚本中有一些口音问题。这是我的 Javascript 代码的一部分:
//process product groups
products.each(function(gid) {
//create groups of products
var gname = this.id.replace(/_/g, ' ');
var gbutton = $('<a />',{'title':gname, 'prod_id':this.id,'href':'#'}).text(gname);
$('<li/>').append(gbutton).appendTo(groups);
//register onclick event for group link
gbutton.click(function(e) {
//make clicked group active
groups.find('.active-group').removeClass('active-group');
$(this).parent().addClass('active-group');
//hide all groups
products.css('display','none');
active_group = $('#' + $(this).attr('prod_id'), shop);
//show only active group
active_group.css({'top':0,'display':'block'});
//animate products by shifting their top position and tweening opacity
active_group.children('li').each(function(i){
$(this).css({'top':parseInt((i+settings.pageColumns)/settings.pageColumns)*settings.groupAnimationShift,'opacity':0});
$(this).delay(i*settings.groupAnimationStartDelay).
animate({'top':0,'opacity':1},settings.groupAnimationTime,settings.groupAnimationEasing);
});
//update number of pages
active_group.current_page = 1;
active_group.pages = Math.ceil(active_group.children('li').length / (settings.pageRows*settings.pageColumns));
//update page scroll
resetPageScroll();
e.preventDefault();
});
它与 HTML 中的 UL id 链接
前任。:
<ul id="Enseignes_Résidentielles">
<li class="product" name="RD-101" price="5" minimum="4" skip="4">
<a class="product-image fancybox" href="images/product_big.jpg" title="Picture 4">
<img src="images/product_2.png" alt="Preview"/>
<div class="text-overlay">
<p class="product-heading">Description</p>
Enseignes résidentielles imprimées sur 2 panneaux 4 mm 36” x 24” collés dos à dos.
</div>
</a>
<p class="product-heading">RD-101 (Simple)</p>
<a href="#" id="test" class="product-buy">Ajouter au panier</a>
<p class="product-meta">Double de pareterre 32x24</p>
<div class="product-price">18<span class="product-currency">$</span></div>
</li>
当我向 UL id 添加重音符号和其他标点符号时,除了购物车 DIV 中的所有功能外,一切都正常工作......如果我的 UL id 不包含重音符号或其他 utf-8 字符,它工作正常。
知道为什么吗?知道如何解决这个问题吗?
编辑
这是现场项目...:http ://danalcoimpressions.com/remax/index.html 试试这个...在第一个选项卡(Enseignes Résidentielles)的任何项目中单击“Ajouter au panier”...悬停购物车选项卡并尝试添加或删除该类别中的项目,但它不起作用。但是在第二个标签(Enseignes Balcon)中尝试同样的事情,标签(UL)名称中没有重音......它在购物车中会很好用。