我将 Magento 1.7.0.2 和 jQuery 1.9.1 与 jGrowl 一起使用。我试图实现的是获取用户的数量值,然后将其显示为右上角的 jGrowl 通知。jGrowl 只是一种使用 $.jGrowl("My Text Here"); 显示文本的方式;这是我到目前为止得到的:
HTML
<div class="add-to-cart bottom">
<input type="text" name="qty" id="qty" maxlength="12" value="500" title="Qty" onclick="$.jGrowl('500 Added To Cart');" class="input-text qty">
<button type="button" title="Add to Cart" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span>Continue to cart</span></span></button>
</div>
jQuery
$('input#qty.input-text.qty').bind("keydown change", function(event){
$.jGrowl(this.value);
});
它可以工作,但我的通知显示 3 个不同的通知是用户类型,如果我在数量框中输入 500,它会显示 5、50,然后在单独的通知中显示 500,有没有办法让它在用户点击后显示输入字段?
提前致谢