.load and .slideDown does not work first time it runs
Im trying to load external html documents inside a div with .load and .slideDown, but the first time I click on a thumb is doesnt run the animation after the first time it works fine.
If I put a alert between .load and .slideDown the first time it shows the content before I dismiss the alert, after that it waits until i dismiss the alert.
$('.thumbs2').click(function() {
var idStr = ("project/"+$(this).attr('id')) + " #box_project2";
$('#close2').fadeIn(500).css({'display': 'block', 'height': '25px'}开发者_运维百科);
$('#box_project2').load(idStr,function(){
$(this).slideDown('slow', function() {
});
$.scrollTo('#gohere',300);
});
});
I am assuming the animation that is not working is ".slideDown" It seems fine since you are calling it in the callback. I would try to see if the fadeIn is messing it up by setting it to display block without the fade so it's instant. Also just to make sure, does #box_project2 already exist prior to this being executed? (sorry I would comment but I do not have enough reputation)
精彩评论