vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: Avatar size limits. - View Topic
Topic Rating: *****
Printable View
ashkir
Full Member
***

[Avatar]

Posts: 1,159
Status: Offline
Gender: Male
Location: Cali!
Age: 32
Joined:  
Reputation: 42%  


pmtwitterskypemsnyahoo
Avatar size limits. (3rd Apr 11 at 5:21am UTC)
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
Ross
Administrator
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 8 14
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
Re: Avatar size limits. (3rd Apr 11 at 11:49am UTC)
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.

Image
ashkir
Full Member
***

[Avatar]

Posts: 1,159
Status: Offline
Gender: Male
Location: Cali!
Age: 32
Joined:  
Reputation: 42%  


pmtwitterskypemsnyahoo
Re: Avatar size limits. (3rd Apr 11 at 11:58pm UTC)
Awesome! Works and it keeps proportions! {Cheesy}
 Printable View

All times are GMT+0 :: The current time is 10:44am
Page generated in 0.2107 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums