2017-03-28 50 views
0

我想用一些html內容打開羽毛燈箱。內容包含一些小圖片,我也想使用羽化圖片來顯示更大的圖片。在沒有雙擊的情況下在Featherlight.js燈箱中打開燈箱 - 是否有可能?

例如:我加入了ajax例子DIV的鏈接將圖像從http://noelboss.github.io/featherlight/

<div class="ajaxcontent lightbox"> 
    <h2>This Ligthbox was loaded using ajax</h2> 
    <p>With <a href="https://github.com/noelboss/featherlight/#installation">little code</a>, you can build lightboxes that use custom content loaded with ajax...</p><a class="btn btn-default" href="assets/images/droplets.jpg" data-featherlight="image">Image</a> 
</div> 

當打開燈箱上IHAVE圖像/按鈕雙擊讓它打開。

是否可以在第一次點擊時打開它?

Example

+0

你有什麼試過?現場示例?你的問題不清楚。 –

+0

親愛的Marc-André, 我在上面添加了一個鏈接到示例(Button Ajax My Example) – mederano

回答

0

假設你想要做的就是打開一個輕如羽毛,並從該輕如羽毛的內容打開一個嵌套的輕如羽毛(這似乎非常奇怪TBH),你可以使用afterOpen回調,在其中您可以使用$.featherlight(...)find('.my-button-or-something').trigger('click')打開嵌套的羽毛燈。

請注意,關閉嵌套featherlight時,第一個羽毛燈仍將打開。