我知道tumblr的圖片尺寸有{photoset-500},{photoset-400},{photoset-250},但我想更改寬度,以便寬度可以是420或350.我到處尋找,找不到代碼來幫助我做到這一點。在tumblr上更改默認圖片尺寸
1
A
回答
1
您不能使用Tumblr標記更改圖像的默認尺寸,但您可以使用CSS在視覺上更改尺寸。
的tumblr標記:
{block:Photoset}
{block:Photos}
<img src="{PhotoURL-500}" class="photoset-img" />
{/block:Photos}
{/block:Photoset}
CSS:
.photoset-img { width: 420px; /* can be any value you want */ }
1
結束標記之前添加此腳本。這將增加或減少photoset的大小
<script type="text/javascript">
//This will change the source address and display the correct size.
$(".photoset").each(function() {
var newSrc = $(this).attr("src").replace('700','860');
$(this).attr("src", newSrc);
});
//This will get the new size of the iframe and resize the iframe holder accordingly.
$(function(){
var iFrames = $('.photoset');
function iResize() {
for (var i = 0, j = iFrames.length; i < j; i++) {
iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 'px';}
}
if ($.browser.safari || $.browser.opera) {
iFrames.load(function(){
setTimeout(iResize, 0);
});
for (var i = 0, j = iFrames.length; i < j; i++) {
var iSource = iFrames[i].src;
iFrames[i].src = '';
iFrames[i].src = iSource;
}
} else {
iFrames.load(function() {
this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
});
}
});
</script>
2
您可以使用{} Photoset剛剛調整大小的photoset以適應集裝箱(最大尺寸700像素)。
相關問題
- 1. PHP:默認圖片尺寸
- 2. 更改TinyMCE默認圖像尺寸
- 3. 上傳時更改圖片尺寸
- 4. 增加tumblr照片尺寸
- 5. 爲什麼Tumblr的默認圖像尺寸最大爲500px?
- 6. HTML默認圖像尺寸
- 7. 在tumblr中選擇照片尺寸API
- 8. iOS:UIPickerView默認尺寸
- 9. 用Woo Commerce更改圖片尺寸
- 10. 用jquery更改圖片尺寸
- 11. img alt更改圖片尺寸
- 12. 更改WordPress中的默認圖像調整大小尺寸
- 13. 更改尺寸圖例的默認顏色
- 14. 默認圖像尺寸在IE8
- 15. 上傳圖片的尺寸
- 16. docbook5默認值的圖形尺寸
- 17. 默認畫布尺寸
- 18. 畫布默認尺寸
- 19. 更改圖的尺寸MATLAB
- 20. 更改尺寸
- 21. 在Tumblr上全局更改默認播放器顏色
- 22. 更改打印機默認紙張尺寸
- 23. 更改波旁威士忌默認em尺寸
- 24. 嵌入式tumblr圖像尺寸
- 25. 在Excel中選擇紙張尺寸(不是默認尺寸)vba
- 26. iPhone圖片尺寸
- 27. 圖片WaterMark尺寸
- 28. 更改照片尺寸Windows Phone 8
- 29. 更改matlab中的影片尺寸
- 30. 如何更改FAB默認圖片
不要忘了調整高度。 '.photoset-img {width:420px;身高:自動; }' – graygilmore 2012-07-20 23:33:03
'auto'是默認值 – 2012-07-21 02:34:19