Skip to content

Instantly share code, notes, and snippets.

@LRancez
Forked from anonymous/gist:2388015
Created November 5, 2012 18:54
Show Gist options
  • Save LRancez/4019571 to your computer and use it in GitHub Desktop.
Save LRancez/4019571 to your computer and use it in GitHub Desktop.
iOS fix for iframe cropping
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
if (/iPhone|iPod|iPad/.test(navigator.userAgent))
$('iframe').wrap(function(){
var $this = $(this);
return $('<div />').css({
width: $this.attr('width'),
height: $this.attr('height'),
overflow: 'auto',
'-webkit-overflow-scrolling': 'touch'
});
});
})
</script>
@LRancez
Copy link
Author

LRancez commented Nov 5, 2012

Probate este

@godaro
Copy link

godaro commented Nov 5, 2012

casi casi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment