关闭厚盒并再次打开它
我正在尝试使用厚盒做一种向导,第一次打开它时效果很好。 当我单击“下一步”时,我想关闭已打开的div并在thickbox中打开一个新的div,但这是如何完成的? 我已尝试以下代码,但它只是关闭厚盒并且不会再次打开它:
tb_show("", "#TB_inline?height=280&width=620&inlineId=divStart", "");
tb_remove();
tb_show("", "#TB_inline?height=280&width=620&inlineId=divContinue", "");
I am trying to do kind of a wizard using thickbox, and it works fine when opening it the first time. When I click next I would like to close the div I have opened and open a new one in thickbox, but how is it done? I have tried the following code, but it just closes the thickbox and doesn't open it again:
tb_show("", "#TB_inline?height=280&width=620&inlineId=divStart", "");
tb_remove();
tb_show("", "#TB_inline?height=280&width=620&inlineId=divContinue", "");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用以下代码:
//dont use tb_remove() function
如果您使用 iframe 加载内容:
You can use this code:
//dont use tb_remove() function
If you use iframe for loading content:
我来到这个答案页面,并尝试了这里提出的解决方案。 它不起作用。 我使用了我的一个老把戏,几乎每次都奏效了。 虽然这篇文章已经有3年多了,但我还是想分享这个技巧。 技巧是使用 window.setTimeout 来延迟对下一个 tb_show() 的调用。
另请注意我使用的另外两个技巧:
我想显示一个模式弹出窗口。HTML 位于 ID 为“confirmDiv”的 div 中。 但它显示的是通常的带有标题和填充的厚盒子。 因此,第二行从 TB_Window 中删除边框和背景颜色,这仅显示弹出 HTML。
我还使用了 300 像素的常规高度宽度,尽管我的弹出窗口只有 250 像素。 即使内容稍大一点,这也会阻止滚动条。 TB_Window 无论如何都没有显示,所以没关系。
希望这对某人有帮助。
I came to this answer page, and tried the solution proposed here. It did not work. I used one of my old tricks, and like almost everytime, it worked. Although this post is more than 3 years old, I wanted to share the trick. The trick is to use window.setTimeout to delay the call to the next tb_show().
Please also note two other tricks I have used:
I wanted to show a modal popup.The HTML was in a div with id "confirmDiv". But it was showing the usual thickbox with title and padding. So the second line removes the border and background color from TB_Window, which shows only the popup HTML.
I also used a general height width of 300px, although my popup was only 250px. This will prevent the scrollbars even if the content is a little bigger. The TB_Window is not showing anyway, so it won't matter.
Hope this helps somebody.
我自己找到了答案。 我打开了一个包含所有步骤的 div,只需通过 javascript 即可决定显示哪个 div。
I found the answer myself. I opened a div containing all the steps, and the just through javascript decided what div to show.