Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 16th, 2012  |  syntax: None  |  size: 0.82 KB  |  hits: 34  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How do I close colorbox iframe with javascript?
  2. $.noConflict();
  3.     jQuery(document).ready(function($){
  4.             $("a[rel='colorbox']").each(function(){
  5.                     var getWidth = parseInt($(this).attr('width'))
  6.                     var getHeight = parseInt($(this).attr('height'))
  7.                     var getScroll = parseInt($(this).attr('scrolling'))
  8.                     if(getScroll == 'yes') { var frameScroll = 'true'; }
  9.                     if(!getWidth) { var getWidth = '720'; }
  10.                     if(!getHeight) { var getHeight = '480'; }
  11.  
  12.                     $(this).colorbox({innerWidth:getWidth, innerHeight:getHeight, scrolling:frameScroll, iframe:true, rel:"nofollow", transition:"elastic"});
  13.             });
  14.     });
  15.        
  16. parent.$.colorbox.close(); return false;
  17.        
  18. parent.jQuery.colorbox.close(); return false;