jQuery-“jQuery;这";元素和;“母公司”;
我正在解决以下问题-我在我的页面上有DB表中项目的语句,每个项目都打印到div。如果用户在这个div上移动鼠标光标,那么将显示div和其他信息jQuery-“jQuery;这";元素和;“母公司”;,jquery,html,hide,this,show,Jquery,Html,Hide,This,Show,我正在解决以下问题-我在我的页面上有DB表中项目的语句,每个项目都打印到div。如果用户在这个div上移动鼠标光标,那么将显示div和其他信息 <div class="dost"> 3 days | <span>deliv</span> <div class="deliv_bubble"> &
<div class="dost">
3 days |
<span>deliv</span>
<div class="deliv_bubble">
<div><strong>aaa</strong></div>
<div><strong>bbb</strong></div>
<div><strong>ccc</strong></div>
</div>
</div>
$('div.dost span').mouseover(function() {
$('div.dost div.deliv_bubble').show();
});
3天|
交付
aaa
bbb
ccc
$('div.dost span').mouseover(函数(){
$('div.dost div.deliver_bubble').show();
});
例如,页面上打印了100次此html结构。我的问题是,当我在文本deliver上移动鼠标光标时,会显示divdeliver\u bubble,但不幸的是,会显示100次。。。我只想展示这一次
谁能帮帮我,我做错了什么?
谢谢请执行以下操作:
$('div.dost span').mouseover(function() {
$(this).parent().find('div.deliv_bubble').show();
});
$(this).parent()将返回相应的父级div.dost
希望这有帮助。干杯这样做:
$('div.dost span').mouseover(function() {
$(this).parent().find('div.deliv_bubble').show();
});
$(this).parent()将返回相应的父级div.dost
希望这有帮助。干杯试试这个:
$('div.dost span').mouseover(function() {
$(this).siblings('div.deliv_bubble').show();
});
试试这个:
$('div.dost span').mouseover(function() {
$(this).siblings('div.deliv_bubble').show();
});
我应该这样做
我应该这样做