This is a well-known event in jQuery, as a result of the fact that the mouse disable function in Internet Explorer is a property. You will need to use the jewery mouseleave / mouseenter methods.
Here is your updated fiddle fiddle using the mouseenter() and mouseleave() methods. It works and has been tested in IE7-9.
For convenience, I have also included the code here:
JS:
$(document).ready(function() { $('#frame').mouseenter(function() { var $this = $(this); $this.append('<div id="overlay">blah blah</div>'); $this.addClass("hover"); }).mouseleave(function() { $('#overlay').remove(); $(this).removeClass("hover"); }); $('#overlay').mouseleave(function() { $(this).remove(); }); });
CSS
#frame { padding:5px; border:1px solid black; width:150px; text-align:center; position:relative; } #frame.hover { border:1px solid red; } #frame img { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=25)"; filter: alpha(opacity=25); -moz-opacity: 0.25; opacity: 0.25; } #frame.hover img { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter: alpha(opacity=100); -moz-opacity: 1; opacity: 1; } #overlay { background-color:black; color:white; height:25px; width:100%; font-size:10px; position:absolute; bottom:0; left:0; }
EDIT: I updated my fiddle and code above based on the results that you described in your comment. It should work completely - let me know if it is not.
A bit more detailed:
This solution uses the jQuery mouseenter and mouseleave because of the many problems that IE has with the hover method. Since you may or may not know, hover is a shortened version of mouseenter / mouseleave , but there are dozens of problems with the hover method that are completely related to IE6-9 (and possibly IE 10, although I have not tested this). For some specific questions, search for “Stack Overflow” or Google for “jQuery hover IE issues” and look at some of the results that appear. For this reason, I always take an extra ten seconds to type mouseenter / mouseleave and not use hover , especially when I already have problems with my code in IE.
Let me know if you have any questions / difficulties. Good luck! :)
source share