I have the following code that isn't working in IE, any thoughts?
<script type="text/javascript" src="assets/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#login-ad').hide();
$('.Sub').click(function() {
$('#login-ad').fadeOut();
$('#remove-for-login').fadeIn();
});
$('.Home').click(function() {
$('#login-ad').fadeOut();
$('#remove-for-login').fadeIn();开发者_StackOverflow中文版
});
$('.Login').click( function() {
$('#login-ad').fadeIn();
$('#remove-for-login').fadeOut();
});
});
</script>
<select>
<option value="Sub" class="Sub">Sub</option>
<option value="Home" class="Home">Home</option>
<option value="Login" class="Login">Login</option>
</select>
<div id="login-ad" >
This text should fade in when Login is chosen.
</div><!-- /login-ad -->
Try the change event instead:
$("select").change(function() {
if( $("select option:selected").val() == "login")
$('#login-ad').fadeIn();
}
Current release is 1.4.2 perhaps that version has this problem solved. I know IE has some very strange bugs depending on the version - ie rotated images display good in FF and Chrome, but unrotated in IE (gave up on it).
Besides that, you could try to use show("slow") and hide("slow") without the fadeIn and -Out.
精彩评论