【发布时间】:2016-01-25 14:27:38
【问题描述】:
我正在实现一个系统,用户单击图像并被重定向到另一个网站。在重定向之前会出现一个模式对话框并确认它们将被重定向到另一个网站。
图像由客户端从后端动态添加,客户端为每个图像添加唯一的服务链接,从而:
<!-- image #1 -->
<a href="#openModal"> <!-- opens the modal dialog -->
<div class="service">
<img src="img.png"> <!-- unique image -->
</div>
</a>
<!-- image #2 etc -->
<a href="#openModal"> <!-- opens the modal dialog -->
<div class="service">
<img src="img2.png"> <!-- unique image -->
</div>
</a>
<!-- clicking on image #1 -->
<div id="openModal">
<p>You will be now redirected to the service provider home page</p>
<a href="http://unique_link_to_img#1_service" target="_blank">Order</a><!-- link entered in the back end of service that is unique with each service provider image -->
</div>
在不知道每张图片的特定 ID 的情况下如何实现这一点?
谢谢哦。
【问题讨论】:
-
您正在使用哪个模式对话框小部件?
-
没有小部件,我只使用这个 css 模式,在我的小提琴中显示:jsfiddle.net/pw8w1x6d/3。这个小提琴用于我网站的另一个部分
标签: javascript jquery modal-dialog advanced-custom-fields