bigView

by ihope

HTML

<div id='placeHolder'>
    <img id='target' src='http://192.168.1.22:8080/static/ngEditor/26-pause.png'/>
    <div id='positor'></div>
</div>

CSS

#target {
    margin:10px auto;
    width : 80%;
    
}
#positor { width:3px;height:3px; background:#f00;}
#placeHolder {
    position : fixed;
    margin:0;
    background:#000;
    overflow:none;
}

JavaScript

$target = $('#target');
target = $target[0];
cs = getComputedStyle(target);
$.fn.fit = function() {
    $that = this;
    that = $that[0];
    $parent = $that.parent();
    
    $parent.height($(window).height());
    
    $that.height( $parent.height() - 20)
    
    nW = that.naturalWidth;
    nH = that.naturalHeight; 
    nHW = nH/nW;
    
     
    $that.height($that.width() * nHW )
    
}; 
$target.fit();
$target.on('click',function(){$(this).fit()})
cH =cs.height