Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 iframe 被一个按钮关闭,这段代码:
parent.jQuery.colorbox.close()
喜欢
<button type="submit" onclick="parent.jQuery.colorbox.close()" ....
我能以某种方式计时这个活动吗?所以它会在 2 秒后关闭。前任?
我正在使用 ColorBox 库。
<button type="submit" onclick="setTimeout(parent.jQuery.colorbox.close,2000)" ...
setTimeout 将延迟执行指定的毫秒数,在本例中为 2000。