Tumblr Photo/Photoset popup

后端 未结 1 584
走了就别回头了
走了就别回头了 2020-12-22 07:27

The theme I use lets photoset images pop up to the grey gallery slide show. If I post only a single photo nothing happens, even when I insert a clickthrough URL. I\'d like t

1条回答
  •  没有蜡笔的小新
    2020-12-22 08:17

    There's no official way for doing this, but you could 'piggyback' tumblr's Lightbox function Tumblr.Lightbox.init() since it's already loaded on your blog for photosets. It accepts an array containing the urls of all the photoset images, but in this case there is only one image so you can just pass that.

    A quick edit of the javascript tumblr appends to every photoset, to allow single photos:

    
    

    In the Edit HTML screen of your theme's Customize, search for the {Block:Photo} and inside, look for the or {PhotoURL tag. You'll need to add an id="{PostID} to the so it will resemble something like this:

    
    

    Once you've done that, copy the modified javascript code block at the top and paste it after the image code, and save. When you click an image post, it should bring up the Lightbox that tumblr uses for photosets and show the vignette background.


    Creating a custom HTML theme

    0 讨论(0)
提交回复
热议问题