Jump to content
MakeWebGames

Recommended Posts

Posted

Re: BBCode Resize

http://criminalexistence.com/ceforums/i ... ic=23871.0

That post demonstrates how to scale down an image to a predefined max size. You would get a x/y list of numbers that you can plug into the img tag as width="y" height="x".

If you just toss in width and height attributes that are the same on all images, then all images will be that size. This code above only scales down images larger than that max size, keeps proportions, and doesn't increase the size of smaller images.

Posted

Re: BBCode Resize

You'd have to hack into the bbcode engine, and after the part where the bbcode engine isolates the contents of tags, you would feed that data into the script I linked to.

It would require some modification of both the bbcode engine and the script I linked to, but that script has a good solid foundation to build on.

Posted

Re: BBCode Resize

in the container you could add

style="width:XXpx; overflow:hide;"

| change the XX to the width u want

i dunno if it will work or distort.

Posted

Re: BBCode Resize

browsers always make the image in the img tag fill the available space. adding width to that will cause the image to resize.

if you wrap the img tag in a div, and apply the width and overflow to the div, then the image in the img tag will be contrained like you're talking about. ;)

of course the portion of the image that doesn't fit the space is simply hidden from view. "overflow: auto" would add scroll bars

Posted

Re: BBCode Resize

yeah overflow auto, but i don't like 2 scroll bars showing, I'm not sure if auto shows both but you can hide the Y scroll bar

overflow-y:hide; oxerflow-x:auto;

something like that

Posted

Re: BBCode Resize

it might be browser specific.

firefox only shows the scroll bar that would be usable. other browsers, I couldn't tell ya

nice tip on the overflow-y/-x lol, never seen that one before

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...