MyBB Community Forums

Full Version: Make overflow of a post become a scroll bar.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is probably a really dumb question but for some time i have been wondering if there is an easy way (without a plugin of course) to make the overflow in the mybb posts not just expand the box. And instead make it a scrolling overflow?

like so:

http://i.imgur.com/uC2Cc.png

Instead of how it currently does it:

http://i.imgur.com/7o0b8.png
One thing you might have not considered is that if each post in a thread has wide pictures, you don't want a scroll bar below each post, it looks terrible.

A better option is to auto reduce the image size to fit in the available width. This way wide images will fit no matter what screen size the user has.
Have a look at the Fit on Page plugin
(2012-10-01, 02:56 PM)JordanMussi Wrote: [ -> ]Have a look at the Fit on Page plugin

Thats nice and all but i dont want to add this plugin, i rather have if incase a member makes a way to wide post. That it become an overscroll, because the problem with the above also happens with the php tags/code tags etc.

In the end if a member makes a to large image i rather not get the whole style messed up, so it doesnt annoy others rather i have it overscroll and then it could always be adjusted by the member when he/she sees it.
*nudge* still looking for a solution to this problem.
Try setting a fixed height and width and then set the overflow property to auto?

.your_post_body_class {
max-width:7em;max-height:7em;overflow:auto;
}
I had had a quick go and got it working here, I tested it on your post;

[Image: z954s.jpg]

I used this code for testing it out here;

#pid_918970{
white-space:nowrap;
overflow:auto;
max-width:750px;
}

If you need help putting it into your theme then paste your postbit/postbit classic template here Smile
After a lot more hairpulling i got it to work. Since so far it worked but was kinda meh, since it was interacting with the post url thingie. So after a lot of trial and error now have it working Smile

Change <table width="100%"> to:

<table width="100%" style="table-layout:fixed;">

And wrap {$post['message']} in a new div:

<div style="overflow-x:auto; max-width:873px;">{$post['message']}</div>

If anybody would have any better suggestions feel free Smile