nyromodal 中的嵌套模态框
我正在使用 PHP 和nyromodal 打开包含一系列图像的模式(从数据库调用)。单击其中一个缩略图时,我希望在已打开的模式之上打开另一个模式(包含较大的图像)。相反,它所做的只是调整已经打开的模式的大小并将图像放入其中。我想要的是一个新的模式,这样当用户关闭新的模式时,旧的模式仍然在它下面打开...
代码:
一个主页:
<script type="text/javascript">
$().ready(function() {
$('a.projectmodaltrigger').nm();
$('a.projectcontentimgtrigger').nm();
});
</script>
<a href="project.php?id=1" class="projectmodaltrigger">
<img src="uploads/projects/1/test1.jpg" border="0" />
</a>
在模式中打开的页面(project.php)上:
<a href="uploads/projectcontent/1/image.jpg" class="projectcontentimgtrigger">
<img src="uploads/projectcontent/1/thumb/image.jpg" border="0" />
</a>
是这可能吗?明智吗?有人可以帮忙吗?
谢谢, 人力资源
I'm using PHP & nyromodal to open a modal containing a series of images (called from the database). When one of these thumbnails is clicked, I want another modal to open (containing the larger image) on top of the already open modal. Instead, all it does is resize the already open modal and put the image in there. What I want is a new modal, so that when the user closes the new modal the old modal is still open underneath it...
Code:
One the main page:
<script type="text/javascript">
$().ready(function() {
$('a.projectmodaltrigger').nm();
$('a.projectcontentimgtrigger').nm();
});
</script>
<a href="project.php?id=1" class="projectmodaltrigger">
<img src="uploads/projects/1/test1.jpg" border="0" />
</a>
On the page that's opened in the modal (project.php):
<a href="uploads/projectcontent/1/image.jpg" class="projectcontentimgtrigger">
<img src="uploads/projectcontent/1/thumb/image.jpg" border="0" />
</a>
Is this possible? Sensible? Can anyone help?
Thanks,
HR
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为你必须在第一个链接中添加 target="_blank":
这样 nyroModal 将在 iframe 中打开目标 php 页面,这应该允许根据需要嵌套模式。
让我知道事情会怎样。
I think you have to add target="_blank" in the first link:
So nyroModal will open the target php page in an iframe and this should allow the nested modal as you need.
Let me know how it will go.
既然我已经自己解决了这个问题,我可以告诉你我做了什么。
为第二个模态提供相同的类“projectcontentimgtrigger”是不够的,您必须明确要求 nyroModal 在模态中堆叠后续链接,如下所示:
最后一件事: if第二级模态必须自己堆叠在模态中,您必须在新页面中的某个位置包含相同的调用(例如为您的project.php)。也许可以用 jquery.live() 解决这个问题(但我没有尝试)。所以再次在“project.php”中:
希望这有帮助!
Since I have solved this issue for myself, I can tell you what I did.
It is not enough to give the second modal the same class "projectcontentimgtrigger", you have to explicitely ask nyroModal to stack the subsequent links in modals like this :
Last thing : if the second level modal must himself stack in a modal, you have to include the same call somewhere in your new page (e.g project.php for you). This could be solved with jquery.live() maybe (I did not try though). So again in "project.php":
Hope this helps !