Original size visitors avatar pictures

Don Von Alpha Dom
by Don Von Alpha Dom · 2 posts
12 years ago in Visitors Panel
Posted 12 years ago · Author
Make sure you put this code at the very end of your imvu page (the panel that is best for this is the very lower right panel!). This code resizes avatar pics back to their original size instead of those small dinky pics that are normally in the visitors panel.

Code
<style type="text/css">
.avPic { width:auto!important; height:auto!important; }
</style>
<script type="text/javascript">
   function getNaturalWidth(dImg) {
      var naturalWidth  = -1;
      if(dImg.naturalWidth != null) {
         naturalWidth = dImg.naturalWidth;
      } else if(dImg.runtimeStyle) {
         dImg.runtimeStyle.width= 'auto';
         dImg.runtimeStyle.height= 'auto';
         dImg.runtimeStyle.borderWidth= '0';
         dImg.runtimeStyle.padding= '0';
         naturalWidth =  dImg.offsetWidth;
         dImg.runtimeStyle.width= '';
         dImg.runtimeStyle.height= '';
         dImg.runtimeStyle.borderWidth= '';
         dImg.runtimeStyle.padding= '';
      } else {
         var dImgBk = dImg.cloneNode(true);
         dImg.className = '';
         dImg.style.width = 'auto !important';
         dImg.style.height = 'auto !important';
         dImg.style.borderWidth= '0 !important';
         dImg.style.padding= '0 !important';
         dImg.removeAttribute('width');
         dImg.removeAttribute('height');
         naturalWidth =  dImg.width;
         dImg.setAttribute('width' , dImgBk.getAttribute('width') );
         dImg.setAttribute('height', dImgBk.getAttribute('height') );
         dImg.style.width = dImgBk.style.width ;
         dImg.style.height = dImgBk.style.height ;
         dImg.style.padding = dImgBk.style.padding ;
         dImg.style.borderWidth=  dImgBk.style.borderWidth ;
         dImg.style.className = dImgBk.style.className ;
      }
      return(naturalWidth);
   }
   function getNaturalHeight(dImg) {
      var naturalHeight  = -1;
      if(dImg.naturalHeight != null) {
         naturalHeight = dImg.naturalHeight;
      } else if(dImg.runtimeStyle) {
         dImg.runtimeStyle.width= 'auto';
         dImg.runtimeStyle.height= 'auto';
         dImg.runtimeStyle.borderWidth= '0';
         dImg.runtimeStyle.padding= '0';
         naturalHeight = dImg.offsetHeight;
         dImg.runtimeStyle.width= '';
         dImg.runtimeStyle.height= '';
         dImg.runtimeStyle.borderWidth= '';
         dImg.runtimeStyle.padding= '';
      } else {
         var dImgBk = dImg.cloneNode(true);
         dImg.className = '';
         dImg.style.width = 'auto !important';
         dImg.style.height = 'auto !important';
         dImg.style.borderWidth= '0 !important';
         dImg.style.padding= '0 !important';
         dImg.removeAttribute('width');
         dImg.removeAttribute('height');
         naturalHeight =  dImg.height;
         dImg.setAttribute('width' , dImgBk.getAttribute('width') );
         dImg.setAttribute('height', dImgBk.getAttribute('height') );
         dImg.style.width = dImgBk.style.width ;
         dImg.style.height = dImgBk.style.height ;
         dImg.style.padding = dImgBk.style.padding ;
         dImg.style.borderWidth=  dImgBk.style.borderWidth ;
         dImg.style.className = dImgBk.style.className ;
      }
      return(naturalHeight);
   }   
   function ResizeIt_imvucodes_net() {
      var imgGroup = document.getElementById('visitors_panel_body').getElementsByTagName('img');
      for (var i=0; i<imgGroup.length; i++) {
         imgGroup[i].style.width=getNaturalWidth(imgGroup[i])+'px';
         imgGroup[i].style.height=getNaturalHeight(imgGroup[i])+'px';
      }
   }
   document.onload=ResizeIt_imvucodes_net();
</script>
Posted 4 years ago
dope thanks dom

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT