I have a table, and when the user clicks on each cell, some details should appear in a small pop-up div that appears where the user clicked. I use jQuery, but do not bind the function to the onclick event.
function detailPopup(cell, event, groupName, groupID, ...)
{
var newDiv = document.createElement("div");
newDiv.id = "detailPop" + groupID;
newDiv.className = "priceDetailPopup";
newDiv.innerHTML = "<p>" + groupName + "</p>";
$(newDiv).click(function()
{
$(this).fadeOut("fast").remove();
}
);
$("#main").append(newDiv);
$(newDiv).css({"left" : event.pageX, "top" : event.pageY}).fadeIn("fast");
}
Everything works fine in FF, Safari, and Chrome. In IE, everything works, except that the div part is displayed below the table. event.pageX / Y do not work. I know that jQuery will fix those used for IE if I bind the function via jQuery as follows:
$(cell).click(function(e) { ... e.pageX ... })
But I can’t do it. (I don’t think I can - if so, explain how I can get six variables in this function without using non-xhtml tags in the cell.)
JQuery "" , JQuery? $JQuery.fixEvent(); -? .
.