3
我無法使用Featherlight模式窗口在頁面加載時顯示內容。如何在頁面加載中使用Featherlight打開DOM元素?
https://github.com/noelboss/featherlight/#usage
https://jsfiddle.net/axxdy4we/
打開羽之DOM與鏈接
<a href="#" class="my-content" data-featherlight="<p>My Content</p>">Open some DOM in lightbox</a>
從data-featherlight
屬性
點擊鏈接時,該鏈接加載HTML內容將載入 「我的內容」 。
在頁面加載
$.featherlight($('.my-content'), {});
這僅加載最新的<a>
標籤之間, 「Open some DOM in lightbox
」。
如何在頁面加載時從data-featherlight
屬性中調用「我的內容」?
我需要有data-featherlight
內的html,而不是外部的div。
我想這可能是這樣的
$('.my-content').featherlight();
$('.my-content').featherlight.current();
它很好用! –