Skip to content

Instantly share code, notes, and snippets.

@edwardsharp
Created January 16, 2014 19:40
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 edwardsharp/8461913 to your computer and use it in GitHub Desktop.
Save edwardsharp/8461913 to your computer and use it in GitHub Desktop.
thickbox.js iPad scrolling hack
jQuery(document).ready(function(){
// start hack #sorry
if ("ontouchstart" in document.documentElement){
jQuery('html').addClass('touch');
}
var style = document.createElement('style');
style.type = 'text/css';
hackystyle = '.touch #TB_window {height: 90%; -webkit-overflow-scrolling: touch !important;overflow: scroll !important;}';
if (style.styleSheet) {
// IE
style.styleSheet.cssText = hackystyle;
} else {
// Other browsers
style.innerHTML = hackystyle;
}
document.getElementsByTagName("head")[0].appendChild( style );
//end hack
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment