<script>
$(".mobile .qtyInput").change(function(){
$(".desktop .qtyInput").val( $(this).val() );
});
$(".desktop .qtyInput").change(function(){
$(".mobile .qtyInput").val( $(this).val() );
});
</script>
您好我正在开发大型商务cms,我面临的问题是每当我尝试更新购物车中的一个产品的数量时,其他数量的产品也会更新,它在移动设备上工作正常,但在桌面上它给我的问题是它也会自动更新其他产品的数量,提前谢谢
<tr class="desktop">
<td class="CartThumb" style="%%GLOBAL_HideThumbColumn%%">
%%GLOBAL_ProductImage%%
</td>
<td class="ProductName" colspan="%%GLOBAL_ProductNameSpan%%">
<a href="%%GLOBAL_ProductLink%%">%%GLOBAL_ProductName%%</a>%%GLOBAL_ProductOptions%%
<br>
%%GLOBAL_ProductAvailability%%
<div class="CartExpectedReleaseDate" style="%%GLOBAL_HideExpectedReleaseDate%%">(%%GLOBAL_ProductExpectedReleaseDate%%)</div>
%%GLOBAL_EventDate%%
<div style="%%GLOBAL_HideWrappingOptions%%" class="WrappingOptions">
%%LNG_GiftWrapping%%:
%%GLOBAL_GiftWrappingName%%
<a href="#" onclick="Cart.ManageGiftWrapping('%%GLOBAL_CartItemId%%');" style="%%GLOBAL_HideGiftWrappingAdd%%">%%LNG_Add%%</a>
<span style="%%GLOBAL_HideGiftWrappingEdit%%">
(<a href="#" onclick="Cart.ManageGiftWrapping('%%GLOBAL_CartItemId%%');">%%LNG_Change%%</a> %%LNG_Or%% <a href="cart.php?action=remove_giftwrapping&item_id=%%GLOBAL_CartItemId%%" onclick="return Cart.RemoveGiftWrapping();">%%LNG_Remove%%</a>)
</span>
<br>
<span style="%%GLOBAL_HideGiftMessagePreview%%">
%%LNG_GiftMessage%%:
%%GLOBAL_GiftMessagePreview%%
</span>
</div>
</td>
<td align="center" class="CartItemQuantity">
%%GLOBAL_CartItemQty%%
</td>
<td align="center" class="CartItemIndividualPrice">
%%GLOBAL_ProductPrice%%
</td>
<td align="right" class="CartItemTotalPrice"><em class="ProductPrice">%%GLOBAL_ProductTotal%%</em>
</td>
</tr>
<tr class="mobile">
<td colspan="6">
<div class="MobileCartItemTop">
<div style="%%GLOBAL_HideCartItemRemove%%">
<a href="cart.php?action=remove&item=%%GLOBAL_CartItemId%%" onclick="Cart.RemoveItem('%%GLOBAL_CartItemId%%'); return false;" class="CartRemoveLink" title="%%LNG_Remove%%"> </a>
</div>
<div class="MobileCartItemImage">
%%GLOBAL_ProductImage%%
</div>
<a href="%%GLOBAL_ProductLink%%" class="ProductName">%%GLOBAL_ProductName%%</a>
</div>
<div class="MobileCartItemBottom">
<div class="MobileCartItemBottomLeft">
<div class="MobileCartItemIndividualPrice">
<span>Price:</span>%%GLOBAL_ProductPrice%%
</div>
%%GLOBAL_ProductOptions%%
%%GLOBAL_ProductAvailability%%
<div class="CartExpectedReleaseDate" style="%%GLOBAL_HideExpectedReleaseDate%%">(%%GLOBAL_ProductExpectedReleaseDate%%)</div>
%%GLOBAL_EventDate%%
<div style="%%GLOBAL_HideWrappingOptions%%" class="WrappingOptions">
%%LNG_GiftWrapping%%:
%%GLOBAL_GiftWrappingName%%
<a href="#" onclick="Cart.ManageGiftWrapping('%%GLOBAL_CartItemId%%');" style="%%GLOBAL_HideGiftWrappingAdd%%">%%LNG_Add%%</a>
<span style="%%GLOBAL_HideGiftWrappingEdit%%">
(<a href="#" onclick="Cart.ManageGiftWrapping('%%GLOBAL_CartItemId%%');">%%LNG_Change%%</a> %%LNG_Or%% <a href="cart.php?action=remove_giftwrapping&item_id=%%GLOBAL_CartItemId%%" onclick="return Cart.RemoveGiftWrapping();">%%LNG_Remove%%</a>)
</span>
<br>
<span style="%%GLOBAL_HideGiftMessagePreview%%">
%%LNG_GiftMessage%%:
%%GLOBAL_GiftMessagePreview%%
</span>
</div>
</div>
<div class="MobileCartItemBottomRight">
<em class="ProductPrice">%%GLOBAL_ProductTotal%%</em>
%%GLOBAL_CartItemQty%%
</div>
</div>
</td>
</tr>