SMF Development > Applied or Declined Requests
CSS-based Avatar Resize
RétroX:
One of the largest problems that I've seen in SMF is the lack of a good avatar resizing system. One suggestion that I have, however, will fix this.
Normally, offsite avatars can be resized via HTML (which usually forces avatars at the max size) or via JavaScript (which requires the page to load entirely before avatars are resized properly. A better method, in my opinion, would be to simply resize them with CSS, which will allow avatars to be resized as the page loads. This would simply be adding 'style="max-width: WIDTH; max-height: HEIGHT;"' to the <img> tag rather than 'width="WIDTH" height="HEIGHT"'. I think that this would be a really good feature, and it's something that SMF is really lacking, in my opinion.
青山 素子:
You can do this in your theme by adding the rule:
--- Code: ---.avatar img {
max-width: 80px;
max-height: 80px;
}
--- End code ---
Replace "80" with the size you want.
Kindred:
Plus, resizing images at page load is less than effective and slow. Someone could load a HUGE image, slow ing the page down immensely.
Bloc:
But theres always a middle-ground: scale the image down to for example 200x200 and THEN use CSS to resize to 70x70, 30x30, 150x150 etc..depending on where its shown. Best of both worlds.
Kindred:
that is true...
Navigation
[0] Message Index
[#] Next page
Go to full version