Reputation: 481
This is my script:
$("#headerimage").animate({marginLeft:"0"},300);
I want to add "fadeIn" as well to start simultaneously and at the exact same speed. How is this done?
Upvotes: 1
Views: 968
Reputation: 2375
$("#headerimage").animate({
marginLeft:"0",
opacity: 1
},300);
Upvotes: 0
Reputation: 318182
By animating the opacity:
$("#headerimage").animate({
marginLeft: 0,
opacity : 1
}, 300);
If it's hidden with display:none, show it first:
$("#headerimage").css({
opacity : 0,
display : 'block' // or whatever
}).animate({
marginLeft: 0,
opacity : 1
}, 300);
Upvotes: 3