Reputation: 2367
Is there any way to make a div expand to right with css when content added to it with ajax? Or should i use javascript for this job?
Also parent container has a width set, but also has overflow:auto. Sorry for late edit
Upvotes: 2
Views: 644
Reputation: 6740
$("#mydiv").animate({
width += 'xxx'
},5000);
You may want your width value to scale with the length of your response. Perhaps create a multiplier.
Upvotes: 1
Reputation: 7370
Since you're using JS to retrieve/add content via AJAX, you could have the JS code add/modify the class on the <div>
as well. Then you can control it with CSS.
Upvotes: 1