-1
設置一個CMS,我想自動限制上傳的圖像,而不會將圖像扭曲或設置爲背景,因爲我希望網站訪問者能夠複製圖像。這可以在CSS或JavaScript中完成嗎?自動圖像裁剪
<div class="outer">
<img src="http://2.bp.blogspot.com/-CMIQjovvgcQ/VOy4zOpkW3I/AAAAAAAAAH4/8cE_5moqRFQ/s1600/happy%2Bholi%2Bphotos.jpg" width="100%"/>
<h2>title</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>
</div>
<div class="outer">
<img src="http://i2.cdn.turner.com/cnnnext/dam/assets/150218160918-stress-super-169.jpg" width="100%"/>
<h2>title</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>
</div>
<div class="outer">
<img src="http://i.telegraph.co.uk/multimedia/archive/02951/photoshopping-peg_2951334k.jpg" width="100%"/>
<h2>title</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>
</div>
CSS
.outer{
width:30%;
float:left;
margin-right:3%;
}
https://jsfiddle.net/tonytansley/9y09b4hh/是問題的一個粗的例子。
對於實際問題是什麼,你能更具體一些嗎? –
那麼,究竟是什麼問題呢? –
聽起來像你正在尋找裁剪腳本?很多谷歌搜索結果爲「javascript圖像裁剪」和「jquery圖像裁剪」 – henry