5 Replies Latest reply on Feb 21, 2014 10:35 AM by Matbathome

    How to launch Shadowbox?

    BadMedWTF

      Hello,

       

      I thought it would be simple but am stuck.

       

      I need to launch a shadowbox from the edge comp.

      My shadowbox installation is all fine and I can launch using the <a> tag, Example: <a href="http://www.youtube.com/watch?v=T7MqEEGGpus" rel="nofollow" target="_top" onclick="return openTopSBX(this);" title="Description of the video here"></a>

       

      Shadowbox function in my iframe head is as follows:

      <script type="text/javascript">

      var sbx = window.parent.Shadowbox;

      function openTopSBX(el){

        if(sbx){

          sbx.open( { content : el.href

                         , player : 'iframe'

                         , title : el.title||''

                         //could include width/height/options if desired

                         }

                      );

          return false;

        }else{ //no Shadowbox in parent window!

          return true;

        }

      }

      </script>

       

       

      Please note: Shadowbox is initialised in the parent page as I am launching it from within an iframe onto the parent.

       

      But when working on the edge comp I need to use the attributes as: window.open("URL", "_self");

       

      The problem is I can't figure out how to move the attributes from <a> tag to the window.open format.

       

      Would really appreciate any help on this!

       

      Thanks!