Skip to content

Instantly share code, notes, and snippets.

@seyDoggy
Forked from raygig/gist:2aa37249bd33f916321a
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seyDoggy/03cb25b39dc76ab21ae1 to your computer and use it in GitHub Desktop.
Save seyDoggy/03cb25b39dc76ab21ae1 to your computer and use it in GitHub Desktop.
Ray's work on iframe popup resizing.
try {
parent.FF.popup.resize(document);
} catch(e) {}
FF.popup = {
resize: function(d,w,h,options) {
options = options ? options : {};
options.inner = options.inner==undefined ? true : options.inner;
options.height = options.height==undefined ? true : options.height;
options.width = options.width==undefined ? false : options.width;
options.force = options.force==undefined ? false : options.force;
b = $(d).find("body");
w = w ? w : b.width();
h = h ? h : b.outerHeight(true);
r = bheight<b.outerHeight(true);
_cb = $.fn["colorbox"];
if((_cb.options.scrolling==false && r) || options.force) {
if(h>wheight) {
b.css("overflow-y","auto");
biframe.attr("scrolling","yes");
options.scrolling = false;
options.height = wheight;
} else {
if(options.inner) {
if(options.height)
options.innerHeight = options.innerHeight ? options.innerHeight : h;
if(options.width)
options.innerWidth = options.innerWidth ? options.innerWidth : w;
} else {
if(options.height)
options.height = options.height ? options.height : h;
if(options.width)
options.width = options.width ? options.width : w;
}
}
_cb.resize(options);
}
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment