Skip to content

Instantly share code, notes, and snippets.

@tvachon
Created June 25, 2012 20:22
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 tvachon/2990997 to your computer and use it in GitHub Desktop.
Save tvachon/2990997 to your computer and use it in GitHub Desktop.
Scrolling div compatible with iOS
<!-- a div for text to accompany the image -->
<div style="margin-top:50px;">DESCRIPTION TEXT CAN GO HERE</div>
<!-- Create a 600px wide div as a viewport to a wider image. Let webkit know that it should scroll when touched on mobile. -->
<div id="framecont" style="background-color:#ffffff; height: 100%; width: 600px; overflow: scroll !important; -webkit-overflow-scrolling:touch !important;"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes">
<!-- Set pixel width in the div below to the width of your actual image -->
<div class="inside" style="width: 1000px;">
<img src="image1000px_wide.jpg" />
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment