Source

mobile-demo-set / static / scrollview / scrollview-nested.html

Full commit
<!DOCTYPE html> 
<html> 
	<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1"> 
	<title>jQuery Mobile Docs - Lists</title> 
	<link rel="stylesheet"  href="../../css/themes/default/" />  
	<link rel="stylesheet"  href="jquery.mobile.scrollview.css" />
	<link rel="stylesheet" href="../../docs/_assets/css/jqm-docs.css"/>
    <style>
		.ui-content.ui-scrollview-clip {
			padding: 0;
		}
		.ui-content.ui-scrollview-clip > div.ui-scrollview-view {
			margin: 0;
			padding: 15px;
		}
		.ui-content.ui-scrollview-clip > .ui-listview.ui-scrollview-view {
			margin: 0;
		}

		.ui-scrollview-clip {
			background-color: #999;
		}

		.ui-scrollview-view {
			background-color: white;
		}

		.square {
			width: 200px;
			height: 200px;
			text-align: center;
			line-height: 200px;
			font-size: 160px;
		}

		.ui-scrollview-clip .ui-scrollview-clip .square {
			background-color: #3CF;
		}

		.ui-scrollview-clip .ui-scrollview-clip .ui-scrollview-clip .square {
			background-color: #F39;
		}

		.ui-scrollview-clip .ui-scrollview-clip .ui-scrollview-clip .ui-scrollview-clip .square {
			background-color: #0F6;
		}

		.ui-scrollview-clip .ui-scrollview-clip .ui-scrollview-clip .ui-scrollview-clip .ui-scrollview-clip .square {
			background-color: #FF6;
		}

		.single-block-view-h, .single-block-view-v {
			width: 200px;
			height: 200px;
		}
		.double-block-view-h {
			border: solid 1px black;
			width: 400px;
			height: 200px;
		}

		.double-block-view-v {
			border: solid 1px black;
			width: 200px;
			height: 400px;
		}

		.single-block-view-h > .view, .double-block-view-h > .view {
			width: 1400px;
			height: 200px;
		}

		.single-block-view-h > .view > .square, .double-block-view-h > .view > .square {
			float: left;
		}

		.single-block-view-v > .view, .double-block-view-v > .view {
			width: 200px;
			height: 1400px;
		}

	</style>
	<script src="../../js/jquery.js"></script>
	<script src="../../js/"></script>
	<script src="jquery.easing.1.3.js"></script>
	<script src="jquery.mobile.scrollview.js"></script>
	<script src="scrollview.js"></script>
	<script src="../../docs/lists/docs/docs.js"></script>
</head> 
<body> 

<div data-role="page">

	<div data-role="header">
		<h1>Nested Scrollviews</h1>
	</div><!-- /header -->

	<div data-role="content">
      <h4>Example 1</h4>
      <p>In the following example the #4 is actually a vertical scrollview embedded within a horizontal scrollview.</p>
      <div data-scroll="x" class="double-block-view-h">
        <div class="view">
      	  <div class="square">1</div>
      	  <div class="square">2</div>
      	  <div class="square">3</div>
      	  <div data-scroll="y" class="square single-block-view-v">
            <div class="view">
              <div class="square">4</div>
              <div class="square">A</div>
              <div class="square">B</div>
              <div data-scroll="x" class="single-block-view-h">
		        <div class="view">
                    <div class="square">C</div>
                    <div class="square">@</div>
                    <div class="square">#</div>
                    <div class="square">$</div>
                    <div class="square">%</div>
                    <div class="square">&amp;</div>
                    <div class="square">*</div>
                </div>
              </div>
              <div class="square">D</div>
              <div class="square">E</div>
              <div class="square">F</div>
            </div>
          </div>
      	  <div class="square">5</div>
      	  <div class="square">6</div>
      	  <div class="square">7</div>
        </div>
      </div>
      <h4>Example 2</h4>
      <p>In the following example the #4 is actually a nested horizontal scrollview embedded within a horizontal scrollview. The idea here is that if you drag-scroll the nested scrollview, once it reaches either end of its view, it should start scrolling the outer view.</p>
      <div data-scroll="x" class="double-block-view-h">
        <div class="view">
      	  <div class="square">1</div>
      	  <div class="square">2</div>
      	  <div class="square">3</div>
      	  <div data-scroll="x" class="square single-block-view-h">
            <div class="view">
              <div class="square">4</div>
              <div class="square">A</div>
              <div class="square">B</div>
              <div class="square">C</div>
              <div class="square">D</div>
              <div class="square">E</div>
              <div class="square">F</div>
            </div>
          </div>
      	  <div class="square">5</div>
      	  <div class="square">6</div>
      	  <div class="square">7</div>
        </div>
      </div>
      <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.</p>
      <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.</p>
      <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.Donec non enim in turpis pulvinar facilisis. Ut felis.</p>
      <p>&nbsp;</p>
      <p></p>
	</div><!-- /content -->
</div><!-- /page -->

</body>
</html>