Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery-“jQuery;这";元素和;“母公司”;_Jquery_Html_Hide_This_Show - Fatal编程技术网

jQuery-“jQuery;这";元素和;“母公司”;

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"> &

我正在解决以下问题-我在我的页面上有DB表中项目的语句,每个项目都打印到div。如果用户在这个div上移动鼠标光标,那么将显示div和其他信息

            <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(); 
});
我应该这样做

我应该这样做