gpt4 book ai didi

javascript - 使用 FeatherLight 显示 DIV

转载 作者:行者123 更新时间:2023-11-28 18:02:45 24 4
gpt4 key购买 nike

我正在使用featherlight lightbox插件来在单击按钮时显示DIV的内容。

这是我的按钮:

<INPUT id="mileageButton" <cfif #get_trips.recordcount# NEQ 0>style="color:red; font-weight: bold;"</cfif> class="mileage" Type="BUTTON" VALUE="Mileage" onClick="$('##mileage-modal-open').trigger('click');"> <a id="mileage-modal-open" href="##" data-featherlight="##mileage" ></a>

这是我的 DIV:

<div id="mileage" style="display:none;">
</div>

我遇到的问题是我不希望 DIV 在单击按钮之前可见,因此我将显示属性设置为“无”。然而它一直隐藏着,因此我的灯箱是空的。

如何在单击按钮时将属性更改为“阻止”,但在关闭灯箱时将属性更改为“无”?

最佳答案

保持您的 DIV 可见并将其放入另一个隐藏的 DIV 中。这样,当featherlight打开它时,它就会显示出来。

关于javascript - 使用 FeatherLight 显示 DIV,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43244037/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com