I have a table, and when the user clicks on each cell, some details should appear in a small popup div that appears where the user clicked. I'm using JQuery, but not to 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>"; // more will go here
$(newDiv).click(function()
{
$(this).fadeOut("fast").remove();
}
);
$("#main").append(newDiv);
$(newDiv).css({"left" : event.pageX, "top" : event.pageY}).fadeIn("fast");
}
Everything is working wonderfully in FF, Safari, and Chrome. In IE, it all works except that the detail div appears below the table. event.pageX/Y aren't working. I know JQuery will fix those for IE if I bind the function through JQuery like this:
$(cell).click(function(e) { ... e.pageX ... })
But I can't do that. (I don't think I can - if you do, please explain how I can get six variables into that function without having to use non-xhtml tags in the cell.)
Is there a way to have JQuery "fix" the event object without binding the function through JQuery? $JQuery.fixEvent(event); or something? I can't find any reference to doing so on their site.
Many thanks in advance.