2012-06-09 43 views
1

我已經能夠讓我的照片大,我的博客上一張照片的帖子,http://blog.seans.ws,但的tumblr的photosets限制我的500像素禁用Tumblr照片或更改它們的大小?

的寬度,我不是如何使的photosets的佈局較大,或者只是diable的功能,並顯示我的照片在高分辨率一個接一個?這裏的photoset代碼:

   {block:Photoset} 
       <article> 
        <span class="break" style="padding-bottom: 19px;"></span> 
        {Photoset-500} 
        {block:Caption} 
         <p>{Caption}</p> 
        {/block:Caption} 
        <p></p> 
        <time>{TimeAgo}</time> 
       </article> 
      {/block:Photoset} 

和這裏的單人照的代碼,我在哪裏能夠做出巨大的照片:

  {block:Photo} 
       <article> 
        <span class="break"></span> 
        <img src="{PhotoURL-HighRes}" class="highres"> 
        <p>{Caption}</p> 
        <time>{TimeAgo}</time> 
       </article> 
      {/block:Photo} 

謝謝!

回答

9

這真的沒有必要使用JavaScript &的的tumblr API。

您可以使用{block:Photos}單獨瀏覽每個Photoset中的照片。

例如,在你的例子:

{block:Photoset} 
    <article> 
     <span class="break" style="padding-bottom: 19px;"></span> 

     <!-- Go through each Photo in the Photoset --> 
     {block:Photos} 
      <img src="{PhotoURL-HighRes}" class="highres"> 
     {/block:Photos} 

     {block:Caption} 
      <p>{Caption}</p> 
     {/block:Caption} 
     <p></p> 
     <time>{TimeAgo}</time> 
    </article> 
{/block:Photoset} 

記住,Documentation是你的朋友:)

+0

嗯,是的,我完全錯過了菲利克斯。謝謝! –

1

如果你想保留的tumblr的photoset網格樣式,看看這個小jQuery插件:https://github.com/PixelUnion/Extended-Tumblr-Photoset

它擴展了Tumblr的默認photoset與EXIF數據,圓角,不同的天溝尺寸等

免責聲明:我在幫助創建它的過程中有一小部分;)

+0

這對於保持tumblr網格風格很好 – Tom

2

在結束標記之前添加此腳本。這將增加或減少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>