この jquery コードで productbox div の ID を取得する必要があります。$this.attr('id) を試しましたが、結果はオブジェクト オブジェクトまたは未定義です。前もって感謝します
Javascript:
$('body').on('mouseenter', 'div.productbox', function()
{
buttonDiv = $(this).children('div.roll');
myTimeout = setTimeout(function()
{
Divid = ?;
buttonDiv.toggle();
}, 500);
});
$('body').on('mouseleave', 'div.productbox', function()
{
buttonDiv.hide();
clearTimeout(myTimeout);
});
$('body').on('hover', 'div.productbox', function()
{
var buttonDiv = $(this).children('div.roll1');
buttonDiv.toggle();
});
HTML:
<div id="40" class="productbox">
<span class="new">Yeni</span>
<div class="roll" style="display: none;">
<input type="button" value="139"> Like <input type="button" value="34"> Comment
</div>
<div class="productpicture" onclick="rload(40)">
<img style="margin:auto; width:180px;overflow:hidden;display:block" src="pictures/40.jpg">
</div>
<div class="ps">
<div class="productname">Giysi</div>
<div class="companyname" onclick="go('2');">Koton</div>
<div class="price">9.99 TL</div>
</div>
</div>