2015-11-16 30 views
1

好吧所以我有一个HTML页面集。当我点击一个按钮时,它会显示另一个html页面,但在一个fancybox里面。在那个页面中我有多个链接。 Whne我点击我希望它从内部的fancybox去那里正常的页面上没有关闭FancyBox链接点击里面fancybox

实例下

第一个PHP页面的链接之一

<?php 
      session_start(); 
      require_once 'connect.php'; 
      ?> 
      <html> 

      <head> 
       <!-- Add jQuery library --> 
      <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> 



      <!-- Add fancyBox --> 
      <link rel="stylesheet" href="/fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" /> 
      <script type="text/javascript" src="/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script> 
      <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css"> 

      <style type="text/css"> 


           html { 
           background: url(images/main.jpg) no-repeat center center fixed; 
           -webkit-background-size: cover; 
           -moz-background-size: cover; 
           -o-background-size: cover; 
           background-size: cover; 
          } 


          .container:before { 
           content: ''; 
           position: absolute; 
           top: -8px; 
           height: auto; 
           right: -8px; 
           bottom: -8px; 
           left: -8px; 
           z-index: -1; 
           background: rgba(0, 0, 0, 0.08); 
           border-radius: 4px; 

          } 

           .dashboard { 



            text-align: center; 

            font-family: ‘Lucida Console’, Monaco, monospace; 





            } 



            .container { 


           clear: both; 
           margin-right: auto; 
          margin-left: auto; 
          position: relative; 
          bottom: 0px; 
          height: auto; 
          margin: 50px auto; 
          padding: 20px 50px 20px; 
          width: 700px; 
          background: transparent; 
          border-radius: 3px; 
          -webkit-box-shadow: 0 0 200px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3); 
          box-shadow: 0 0 200px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3); 
        } 

        .a { 
         text-decoration: none; 


        } 




        </style> 

       </head> 

       <body> 
      <div class='container'> 
       <div class='dashboard'> 

      <div class='pure-button'><a class="fancybox fancybox.iframe" href="test1.php" target="_parent">Hospital Orders</a></div> 
      <br> 
      <div class='pure-button'><a class="fancybox fancybox.iframe" href="test2.php" target="_parent">Patient Orders</a></div> 
      </div> 
      </div> 









      <script type="text/javascript"> 
       $(document).ready(function() { 
        $(".fancybox").fancybox(); 
       }); 
      </script> 







       </body> 

       </html> 

这是

的Test1.php页
<?php 
        session_start(); 
        require_once "connect.php"; 
        ?> 
        <html> 

        <head> 
          <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css"> 
         <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
         <link rel="stylesheet" type="text/css" href="tablecss.css"> 
         <style type="text/css"> 


             html { 
             background: url(images/main.jpg) no-repeat center center fixed; 
             -webkit-background-size: cover; 
             -moz-background-size: cover; 
             -o-background-size: cover; 
             background-size: cover; 
            } 


            .container:before { 
             content: ''; 
             position: absolute; 
             top: -8px; 
             height: auto; 
             right: -8px; 
             bottom: -8px; 
             left: -8px; 
             z-index: -1; 
             background: rgba(0, 0, 0, 0.08); 
             border-radius: 4px; 

            } 

             .dashboard { 



              text-align: center; 

              font-family: ‘Lucida Console’, Monaco, monospace; 





              } 



              .container { 


             clear: both; 
             margin-right: auto; 
            margin-left: auto; 
            position: relative; 
            bottom: 0px; 
            height: auto; 
            margin: 50px auto; 
            padding: 20px 50px 20px; 
            width: 700px; 
            background: transparent; 
            border-radius: 3px; 
            -webkit-box-shadow: 0 0 200px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3); 
            box-shadow: 0 0 200px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3); 
          } 




          </style> 
        </head> 












        <body> 
        <div class="container"> 

         <?php 
         include 'linksdb.php'; 
         ?> 

         </div> 

         <br> 

         <div class='new'> 

          <form action="savepending.php" method='POST'> 




         </form> 

         </div> 







        </body> 



        </html> 

正如你所看到的,当它打开了test1.php它也装载linksdb.php Insdie有mnay链接。

<?php 


     $tech = $_SESSION['username']; 



     //$query = mysqli_query($con, "SELECT * FROM newworders WHERE tech = '".$tech."'") or die(mysqli_error()); // get any actual error 

     $query = mysqli_query($con, "SELECT * FROM newworders WHERE test = 'Yes' AND tech = '$tech'"); 




     echo "<table id='tb' border='1'> 

        <th>Test These</th> 
       <tr class='head'> 
        <th>First Name</th> 
        <th>Last Name</th> 
        <th>time</th> 
        <th>space</th> 
        <th>noise</th> 
        <th>Complete</th> 

       </tr>"; 

     while($row = mysqli_fetch_array($query)) { 

     echo "<tr>"; 




      echo "<td>" . '<a href="orderpage.php?uid=' . $row['ID'] . '">' . $row['first'] . '</a><br />' . "</td>"; 

      echo "<td>" . '<a href="orderpage.php?uid=' . $row['ID'] . '">' . $row['last'] . '</a><br />' . "</td>"; 

      echo "<td>" . '<a href="orderpage.php?uid=' . $row['ID'] . '">' . $row['time'] . '</a><br />' . "</td>"; 

      echo "<td>" . '<a href="orderpage.php?uid=' . $row['ID'] . '">' . $row['space'] . '</a><br />' . "</td>"; 

      echo "<td>" . '<a href="orderpage.php?uid=' . $row['ID'] . '">' . $row['noise'] . '</a><br />' . "</td>"; 



      echo "<td>" . "<input type='checkbox' value='Yes' name='complete'" . '<br />' . "</td>"; 






    } 





     ?> 

现在,如果我点击linksdb.php中的任何链接,我希望它转到父页面上的链接。不是在花哨的盒子里面

回答

0

我使用下面的工作。

echo "<td>" . '<a href="orderpage.php?uid=' . $row['ID'] . '" target="_parent">' . $row['first'] . '</a><br />' . "</td>"; 

Target =“_ parent”完美地为我工作。