display jquery prettyPhoto lightbox in parent from iframe

display jquery prettyPhoto lightbox in parent from iframe

I have been trying to get some assistance with this issue for a while now. I know this issue has been discussed before but I can't seem to get it to work. I have a master html page with an iframe on that page. I am using jquery prettyphoto and I was wondering how I can get the light box to display in the parent window when I click on the link in the iframe?

Please see my code below:

Master Page:



 
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Master Page</title>
  6. </head>
  7. <body>
  8. <p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p>
  9. <iframe src="iframe.html" width="300" height="300px" frameborder="0"></iframe>
  10. </body>
  11. </html>

 

iFrame Page:

 

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>iframe</title>
  6. <style type="text/css" media="screen">
  7. @import url("assets/css/infotech-iframes.css");
  8. @import url("assets/css/infotech-popup.css");
  9. </style>
  10. <script src="assets/js/jquery.js" type="text/javascript" charset="utf-8"></script>
  11. <script src="assets/js/jquery.popup.js" type="text/javascript" charset="utf-8"></script>
  12. </head>
  13. <body>
  14. <a href="assets/images/screenshots/campaign-setup-lg.png" rel="prettyPhoto[gallery]"><img src="assets/images/screenshots/campaign-setup-sm.gif" /></a>
  15. <script type="text/javascript" charset="utf-8">
  16. $(document).ready(function(){
  17. $("a[rel^='prettyPhoto']").prettyPhoto();
  18. });
  19. </script>
  20. </body>
  21. </html>
 
Thanks