Almost giving up after 2 days... .fadeOut() with jQuery 1.7.1 + IE9 does not work on the <tr>
element. Can anyone else confirm if this is a known issue? Works in FF and Chrome.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("jquery", "1.7.1");</script>
<script type="text/javascript">
$("document").ready(function() {
$("a.delete").click(function() {
$(this).parent().parent().fadeOut();
return false;
});
});
</script>
<style>
a, td { background-color: #ececec; padding: 5px; }
</style>
</head>
<body>
<table>
<tr><td><a class="delete" href="#">delete</a></td><td>apple</td></tr>
<tr><td><a class="delete" href="#">delete</a></td><td>orange</td></tr>
<tr><td><a class="delete" href="#">delete</a></td><td>pear</td></tr>
</table>
</body>
</html>
EDIT: This updated code below will reveal more information about the issue. I found out that if your mouse moves away from the <tr>
after click the <tr>
will fadeOut correctly i.e. update its style
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("jquery", "1.7.1");</script>
<script type="text/javascript">
$(document).ready(function() {
$("a.delete").click(function() {
$(this).parent().parent().fadeOut();
return false;
});
$("a.show").click(function() {
$("tr").fadeIn();
})
$("a.delete-tr").click(function() {
$("tr").each(function(i, e) {
if($(e).css("display") != "none") {
$(e).fadeOut();
return false;
}
});
})
});
</script>
<style>
table { background-color: red; }
a, td { background-color: #ececec; padding: 5px; }
</style>
</head>
<body>
<p><a class="show" href="#">show</a></p>
<p><a class="delete-tr" href="#">delete row</a></p>
<table>
<tr><td><a class="delete" href="#">delete</a></td><td>apple</td></tr>
<tr><td><a class="delete" href="#">delete</a></td><td>orange</td></tr>
<tr><td><a class="delete" href="#">delete</a></td><td>pear</td></tr>
</table>
</body>
</html>