Skip to content

Instantly share code, notes, and snippets.

@Rockncoder
Created July 11, 2012 14:29
Show Gist options
  • Select an option

  • Save Rockncoder/3090725 to your computer and use it in GitHub Desktop.

Select an option

Save Rockncoder/3090725 to your computer and use it in GitHub Desktop.
JQMImageScalePan - using iScroll 4 to pan and HTML to scale an image
<!DOCTYPE html>
<html>
<head>
<title>JQMImageScalePan</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes"/>
<link href="content/jquery.mobile-1.1.0.min.css" rel="stylesheet" type="text/css" />
<link href="content/style.css" rel="stylesheet" type="text/css" />
<script src="scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="scripts/jquery.mobile-1.1.0.min.js" type="text/javascript"></script>
</head>
<body>
<div id="scalePage" data-role="page" data-rockncoder-jspage="scalePage">
<header data-role="header" data-position="fixed">
<h1>Scaled</h1>
</header>
<section data-role="content" id="scaleContent" >
<div id="picFrame">
<img id="scalePic"/>
</div>
</section>
<footer data-role="footer" data-position="fixed">
<h1><a data-role="button" data-theme="e" href="#panPage">Pan</a></h1>
</footer>
</div>
<div id="panPage" data-role="page" data-rockncoder-jspage="panPage">
<header data-role="header" data-position="fixed">
<h1>Panning</h1>
</header>
<section data-role="content" class="scroller">
<div id="wrapper">
<div id="scroller">
<ul>
<li><img id="panPic"/></li>
</ul>
</div>
</div>
</section>
<footer data-role="footer" data-position="fixed">
<h1><a data-role="button" data-theme="e" data-rel="back" href="#scalePage">Scale</a></h1>
</footer>
</div>
<div style="display: block; position: fixed; left: -10000px; top: 0px;">
<img id="hiddenPic" src="squirrel_eating_1280x1024.jpeg" />
</div>
<script src="scripts/iscroll-lite.js" type="text/javascript"></script>
<script src="scripts/app.js" type="text/javascript"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment