vForums Support > Programming & Coding :: Code Requests & Support :: > Avatar size limits.

Avatar size limits. - Posted By ashkir (ashkir) on 3rd Apr 11 at 5:21am
I am using this:

Code:
 
  1. <script>
  2. /*Remove Avatar Max Size
  3. Created By Wrighty*/
  4.  
  5. for(i=0;i<get('img','tag').length;i++){
  6.     if(get('img','tag')[i].alt == '[Avatar]'){
  7.         get('img','tag')[i].removeAttribute('style');
  8.     }
  9. }
  10. </script>
 


But... I know we'll eventually get a member triyng to use one that is too big. I want a way to just limit it to 120 by 250px please since we cannot set max height/width by vForums yet.

I know there is a {avatar_width} and height, and url in templates. But, it still limits itself to 100x100

Re: Avatar size limits. - Posted By Ross (admin) on 3rd Apr 11 at 11:49am
Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*Remove Avatar Max Size
  4. Created By Wrighty*/
  5.  
  6. for(i=0;i<get('img','tag').length;i++){
  7.     if(get('img','tag')[i].alt == '[Avatar]'){
  8.         get('img','tag')[i].removeAttribute('style');
  9.         get('img','tag')[i].style.maxWidth = '120px';
  10.         get('img','tag')[i].style.maxHeight = '250px';
  11.     }
  12. }
  13. //-->
  14. </script>
 


You can give that a go. Just don't quite remember which versions of Internet Explorer support Max Width/Height properties.

Re: Avatar size limits. - Posted By ashkir (ashkir) on 3rd Apr 11 at 11:58pm
Awesome! Works and it keeps proportions! {Cheesy}