I have an IE bug that I'm not sure how to fix.
Using jQuery I'm dynamically moving a menu to appear on an element on mouseover.
My code (simplified) looks something like this:
$j = jQuery.noConflict();
$j(document).ready(function()
{
//do something on the menu clicks
$j('div.ico').click(function() { alert($j(this).parent().html()); });
setUpActions('#tableId', '#menuId');
});
//on mouseover set up the actions menu to appear on mouseover
function setUpActions(tableSelector, menuSelector)
{
$j(tableSelector + ' div.test').mouseover(function()
{
//note that append will move the underlying
//DOM element with all events from it's old
//parent to the end of this one.
$j(this).append($j(menuSelector).show());
});
}
This menu doesn't seem to register events correctly for the menu after it's been moved in IE7, IE8 and IE8-as-IE7 (yeah MS, that's really a 'new rendering engine' in IE8, we all believe you).
It works as expected in everything else.
You can see the behaviour in a basic demo here.
In the demo you can see two examples of the issue:
You can see (2) in IE8's dev tools:
$j('#testFloat div.ico:first').click()
to manually call any subscribed eventsThis means that I'm not losing the event subscriptions, they're still there, IE's just not calling them when I click.
Does anyone know why this bug occurs (other than just because of IE's venerable engine)?
Is there a workaround?
Could it be something that I'm doing wrong that just happens to work as expected in everything else?
Support for Internet Explorer 7 will end on October 10th, 2023 alongside the end of support for Windows Embedded Compact 2013.
Internet Explorer 6 was the last version to be called Microsoft Internet Explorer. The software was rebranded as Windows Internet Explorer starting in 2006 with the release of Internet Explorer 7. Internet Explorer 6 is no longer supported, and is not available for download from Microsoft.
Internet Explorer 7(8) is not compatible with your system. You are running Windows 10 64-bit. Although Internet Explorer 7(8) will not run on your system, you can download Internet Explorer 8 for other operating systems.
Strangely, although your click event isn't firing in IE, if you change it to either mousedown or mouse up it works as you'd expect although you still have your image hover issue.
$j('div.ico').mouseup(function() { alert($j(this).parent().html()); });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With