Skip to content

Instantly share code, notes, and snippets.

@interactivellama
Created November 9, 2015 19:53
Show Gist options
  • Select an option

  • Save interactivellama/66edd03581bc22fe9e93 to your computer and use it in GitHub Desktop.

Select an option

Save interactivellama/66edd03581bc22fe9e93 to your computer and use it in GitHub Desktop.
function _getContainer(element) {
var containerElement, isWindow;
if (element.attr('data-target')) {
containerElement = element.attr('data-target');
isWindow = false;
} else {
containerElement = window;
isWindow = true;
$.each(element.parents(), function (index, value) {
if ($(value).css('overflow') !== 'visible') {
containerElement = value;
isWindow = false;
return false;
}
});
}
return {
overflowElement: $(containerElement),
isWindow: isWindow
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment