Please excuse the bad title of this post. I have made a function in jQuery that allows the user to hover a certain element (in this case a small image within a row on a scoreboard). Here is the code:
function showComment() {
// Introduce short variables
$commImg = $('img.comment-img');
$comment = $('.comment');
// On mouse-over...
$commImg.mouseover(function() {
$commImg.mousemove(function(e) {
$comment.css('left', e.pageX + 15);
$comment.css('top', e.pageY + 15);
$comment.show();
});
});
$commImg.mouseout(function() {
$comment.hide();
});
}
It works pretty well, however, ALL of the <div class="comment">s are showing (stacked on top of eachother) when hovering any of the images on the scoreboard. I want just one specific DIV to show up that corresponds to a certain row on the scoreboard. Since every row in the scoreboard potentially can contain unique comments, I really need to just show one specific comment for each of these rows.
EDIT: I know WHY this is happening, I just don't know how to approach the problem.
Any help is greatly appreciated!
This post has been edited by oha055: 30 May 2012 - 01:43 PM

New Topic/Question
Reply



MultiQuote




|