title: How do I close colorbox iframe with javascript?
body: <p>I need to close the colorbox iframe that overlays the website with an onclick event. I have seen the code as <code>parent.$.colorbox.close(); return false;</code>, but it doesn't work for me when I use it like this: <code>&lt;a onclick="parent.$.colorbox.close(); return false;"&gt;close&lt;/a&gt;</code>. I think that it is because I am not using a standard colorbox script to call the iframe. I modified it so that I can get height and width from the html anchor tag:</p>
  
  <p>MY COLORBOX SCRIPT:</p>
  
  <pre><code>$.noConflict();
      jQuery(document).ready(function($){
              $("a[rel='colorbox']").each(function(){
                      var getWidth = parseInt($(this).attr('width'))
                      var getHeight = parseInt($(this).attr('height'))
                      var getScroll = parseInt($(this).attr('scrolling'))
                      if(getScroll == 'yes') { var frameScroll = 'true'; }
                      if(!getWidth) { var getWidth = '720'; }
                      if(!getHeight) { var getHeight = '480'; }
  
                      $(this).colorbox({innerWidth:getWidth, innerHeight:getHeight, scrolling:frameScroll, iframe:true, rel:"nofollow", transition:"elastic"});
              });
      });
  </code></pre>
  
  <p>What do I need to use to close this iframe onclick?</p>