html - jQuery - "this" element and "parent(s)" -


i solving following problem - have on page statement of items db table , every item printed div. if user move cursor of mouse on div, show div other information.

            <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();  }); 

on page e.g. 100 times printed html structure. problem is, when move mouse cursor on text deliv, div deliv_bubble showed, unfortunately 100 times... trying display 1 time...

can me, please, doing wrong? thank you

do this:

$('div.dost span').mouseover(function() {     $(this).parent().find('div.deliv_bubble').show();  }); 

$(this).parent() return corresponding parent div.dost

hope helps. cheers


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -