• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Restrict Images to a certain size - For a 'Created' Page?:


Well-known member
You can do a max-width: 100% on the img tag on the page, should work about the same. Click to expand will require javascript though, it can probably be done with a simple jQuery function.


Well-known member
Since Jake like my comment, it was brought to my attention again, so I thought I would check out how difficult it would be to do this via JS. I managed to get it working with a VERY simple jquery function here.

What it does is simple, when you click the image, it checks to see if the max-width for the img element is set to 100%, if it is, it changes it to 172px, else it sets it back to 100%. It should work on multiple elements, just change:
and it checks for the class myimage instead of the id.

To use it, just add this to the top of your page:
<script type='text/javascript'>
    if ($(this).css('max-width') == '100%') {     
        $(this).css({'max-width' : '172px'})
    else {
        $(this).css({'max-width' : '100%'})
Then add this to extra.css:
.myimg { max-width: 100%; }
You can of course change the class name to whatever you want, but you need to change it in the function as well. I have not tested it with the jQuery version xF uses, but I don't think it should cause any problems.