[ACCEPTED]-Why doesn't jquery fadeIn() work with .html()?-fadein
Accepted answer
No fadeIn is done because the #message element 2 is visible, hide it, add the content and 1 fade it in:
$('#message').hide().html("You clicked on a checkbox.").fadeIn('slow');
after analize this problem, that I have 2 to solve, this is my code, that works to 1 use fadeout, change html and fadein
$("#div_big_picture").fadeOut('slow',function(){
$(this).html("<img src='" + str_to_load + "' height='800px' />")
}).fadeIn("slow");
No idea why but I've had trouble chaining 2 this before. You can get the effect you 1 want by using this less elegant code:
google.load("jquery", "1.3.2");
//run when page is loaded
google.setOnLoadCallback(function() {
$('.checkboxList .row').css('color','red');
$('.checkboxList input').attr('checked', true);
$('.checkboxList input').bind('click', function() {
$('#message').hide(); //just in case
$('#message').html("You clicked on a checkbox.");
$('#message').fadeIn('slow');
});
});
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.