jQuery width returning value in percent - how to fix

jQuery width returning value in percent - how to fix

Hello,

I wrote application where I used JQuery.iviewer (https://github.com/can3p/iviewer/wiki it's preview browser for image).
I had a problem with fit function because it has container width and height = 100 (percent from css) so the image is not correct fiting.
I modified function fit (to take actual container width and height):
  1. this.options.height = $(this.container).height();
  2.  this.options.width = $(this.container).width();
but it still giving me value 100 (both for width and height).

the strange is when I try to drag image, the image suddenly center on page and now
  1. this.options.height = $(this.container).height();
  2. this.options.width = $(this.container).width();
giving me correct value for container.

my code:

  1. <div id="dijit_layout_ContentPane_10" class="dijitContentPane dijitBorderContainer-child dijitBorderContainer-dijitContentPane dijitBorderContainerPane dijitAlignCenter" title="" role="group" widgetid="dijit_layout_ContentPane_10" style="left: 5px; top: 40px; position: absolute; width: 759px; height: 625px;">
  2. <div class="tif_iviewer_wrapper_container" style="height: 100%;">
  3. <div id="tiff_iviewer" class="tif_iviewer_container iviewer_cursor" style="height: 100%; overflow: hidden;">
  4. <img style="position: absolute; top: -150px; left: -124px; max-width: none; width: 1271px; height: 898px; overflow: hidden;" src="invoice/4/image/page/0">
  5. </div>
  6. </div>
  7. </div>