 <p>The problem is that your selector matches all .popup_msg, not only the one you need. Use the find() method to get the correct popup in the $('.t').click function:</p> <pre><code>jQuery('.t').click(function(e) { var popup_msg = jQuery(this).find('.popup_msg'); var height = popup_msg.height(); var width = popup_msg.width(); leftVal=e.pageX-(width/1.5)+"px"; topVal=e.pageY-(height/13)+"px"; popup_msg.css({left:leftVal,top:topVal}).show(); }); </code></pre> <p>Note: I haven't tested this code, it might not be 100% correct but hopefully you get what I mean.</p>