javascript - jQuery ID matching -


this toggle on mouseover event works fine:

jquery(document).ready(function(){     jquery(".info").hide();     jquery(".trigger").mouseout(function(){         jquery(".info").slideup(200);     });     jquery(".trigger").mouseover(function(){         jquery(".info").slidetoggle();     }); }); 

but have many objects if trigger trigger, shows me areas info class. easiest way adding id :

<div class="trigger" id="1">details</div> <div class=" info" id="1">     <p> <b> projektbeschreibung </b> </p>     <p> lorem ipsum one. </p> </div>  <div class="trigger" id="2">details</div> <div class=" info" id="2">     <p> <b> projektbeschreibung </b> </p>     <p> lorem ipsum two. </p> </div> 

so trigger triggering info witch belongs. i'm not jquery, question how id matching js code?

inside callbacks, refer object called this:

jquery(document).ready(function(){     jquery(".info").hide();     jquery(".trigger").mouseout(function(){          jquery(this).slideup(200);     });     jquery(".trigger").mouseover(function(){          jquery(this).slidetoggle();     });     }); 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -