2017-04-06 54 views

回答

1

見的,而不是你的scalingimage,其中scale divimage存在看scroll兩個axis i.e x and y。我只做了一些改動html structure只是爲了解這個jsFiddle

$(document).ready(function(){ 
 
\t $("#box > .ch").css({ 
 
    \t 'transform' : 'scale(1.8)', 
 
    'transition' : '1s ease' 
 
    }); 
 
});
#box{ 
 
    overflow-x: auto; 
 
    overflow-y: auto; 
 
    display: flex; 
 
    background:red; 
 
    flex-direction: column; 
 
} 
 
#box > .ch{ 
 
    flex:1; 
 
    flex-shrink: 0; 
 
    background: #fff; 
 
    overflow: auto; 
 
} 
 
#box > .ch > img{ 
 
    width:100%; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<div id="box"> 
 
    <div class="ch"> 
 
    <img src = "https://s3-us-west-2.amazonaws.com/cbsapp/package_content/s78c_e4vt6/main_images/pg_4.jpg"> 
 
    </div> 
 
</div>

+0

@raju希望這有助於。 – frnt

+0

非常感謝先生 – raju

+0

歡迎@raju :-) – frnt