首页 > 解决方案 > 打开 Modal 并将 URL 发送到 iFrame

问题描述

我需要将包含一些字符串数据的 URL 发送到名为“galiframe”的 iframe。这是一个基本的图片库,因此,在模态框的链接中,我需要发送图片名称、物理地址和其他一些项目来识别用户 ID、请求 #、麦克风......但是,打开 Modal 的 jQuery 链接不允许我这样做。有什么建议吗?PS 我正在使用经典的 .asp 和 jQuery css...尽量不要笑得太厉害...我老了,我的代码也老了。

<!-- Remember to include jQuery :) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>

<!-- jQuery Modal -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.css" />
</head>
<body>
    <style>
     body {font-family: Arial, Helvetica, sans-serif;}

     /* The Modal */
     .modal {
       background-image: url("bgimg.png");
       background-repeat: no-repeat;
       background-color: #5DADE2;
       width: 80%;
       -webkit-animation-name: animatetop;
       -webkit-animation-duration: 0.4s;
       animation-name: animatetop;
       animation-duration: 0.4s
       border-radius: 10px;
       box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    }

     /* Add Animation */
     @-webkit-keyframes animatetop {
     from {top:-300px; opacity:0} 
     to {top:0; opacity:1}
    }

     @keyframes animatetop {
     from {top:-300px; opacity:0}
     to {top:0; opacity:1}
    }

    /* iframes Container */
    .frameset {
      display:inline-block;
      width: 100%;
      border: 0;
     }
   </style>
   <div id="ex1" class="modal">
      Image Gallery
      <div class="frameset">
        <iframe src="" name="galiframe"></iframe>
        <iframe src="listimg.asp" name="listframe"></iframe>
      </div>
    </div>

    <!--- Attach link from img to open the modal --->
    <!---Also sending URL to galliframe for img retrieval --->

    <a href="#ex1" rel="modal:open">URL, Edit this image</a>
    <a href="#ex1" rel="modal:open">URL, Edit a different image</a>

标签: javascriptjquerycss

解决方案


推荐阅读