私はstackoverflowとJqueryを初めて使用していますので、前もって不慣れであることをお詫びしたいと思います。MouseEnterでの単純なJqueryの表示質問
本質的に、ボタンがmouseEnter状態にあるときにdivを表示しようとしています。このコードは動作しません何らかの理由で
<div id="select-product-reminder" style="width:200px; height:30px; background-color:#F00; display:none;">Please Choose an Item</div>
<button type="button" id="main-button-btn-cart" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="productAddToCartForm.submit()">
<?php echo $this->__('+ADD TO CART') ?>
</button>
...
はここでのjQueryで私の試み...
$('#main-button-btn-cart').bind('mouseenter', function() {
var $select_button = $('#select-product-reminder');
$select_button.style.display = 'inline-block';
});
だとHTMLです。しかし、私のバインド機能に警告ボックスを含めると、警告ボックスが表示されることに注意することは有益かもしれません。
事前にお問い合わせいただきありがとうございます!
.css( 'display'、 'inline-block')の代わりに.show()を使用してください。 – Rbacarin
ありがとう、完璧に働いています! –
送信ボタンのonclick値も変更しようとしています。 Jqueryを使ってどうすればいいですか? –