Reputation: 179
The content I'm loading with jquery .load() takes up too much of the screen when it loads into a small div?
Anyone know what's going on here? Any way to style content while it's in transition?
$('.selector').hide("slide",{direction:"right"},1000,function() {$('.display').load('..content/content.php')});
$('.selector').show("slide",{direction:"left"},1000);
Upvotes: 0
Views: 30
Reputation: 542
You can handle it in many different visual style, I will give two examples:
$('.display')
to be hidden by default, then on the success callback
of load()
(third parameter), style it to become visible.diplay
a style of fixed height, while the container (the .selector
) has the style of overflow: hidden
, then when the animation is finished, turn it back to overflow: none
generally, your problem is with animation. Also, I recommend using the function $.ajax()
which gives you more control over the flow of loading. It has many more callback
s.
Upvotes: 1