the script is working as long as there is nothing on the page (no div content)
- $( document ).one( "pagecreate", ".demo-page", function() {
- $( "#header" ).toolbar({ theme: "b" });
- $( "#footer" ).toolbar({ theme: "b" });
- function navnext( next ) {
- $( ":mobile-pagecontainer" ).pagecontainer( "change", next + ".html", {
- transition: "slide"
- });
- }
- function navprev( prev ) {
- $( ":mobile-pagecontainer" ).pagecontainer( "change", prev + ".html", {
- transition: "slide",
- reverse: true
- });
- }
- $( document ).on( "swipeleft", ".ui-page", function( event ) {
- var next = $( this ).jqmData( "next" );
- if ( next && ( event.target === $( this )[ 0 ] ) ) {
- navnext( next );
- }
- });
- $( document ).on( "click", ".next", function() {
- var next = $( ".ui-page-active" ).jqmData( "next" );
- if ( next ) {
- navnext( next );
- }
- });
- $( document ).on( "swiperight", ".ui-page", function( event ) {
- var prev = $( this ).jqmData( "prev" );
- if ( prev && ( event.target === $( this )[ 0 ] ) ) {
- navprev( prev );
- }
- });
- $( document ).on( "click", ".prev", function() {
- var prev = $( ".ui-page-active" ).jqmData( "prev" );
- if ( prev ) {
- navprev( prev );
- }
- });
- });
-
- $( document ).on( "pageshow", ".demo-page", function() {
- var thePage = $( this ),
- title = thePage.jqmData( "title" ),
- next = thePage.jqmData( "next" ),
- prev = thePage.jqmData( "prev" );
-
- $( "#trivia-button" ).attr( "href", "#" + thePage.find( ".trivia" ).attr( "id" ) );
-
- $( "#header h1" ).text( title );
- if ( next ) {
- $( ":mobile-pagecontainer" ).pagecontainer( "load", next + ".html" );
- }
- $( ".next.ui-state-disabled, .prev.ui-state-disabled" ).removeClass( "ui-state-disabled" );
- if ( ! next ) {
- $( ".next" ).addClass( "ui-state-disabled" );
- }
- if ( ! prev ) {
- $( ".prev" ).addClass( "ui-state-disabled" );
- }
- });
here is html:
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>New York</title>
- <link rel="stylesheet" href="swipe_files/jquery.mobile-1.4.2.min.css">
- <link rel="stylesheet" href="swipe_files/jqm-demos.css">
- <link rel="stylesheet" href="swipe_files/swipe-page.css">
-
- <script src="swipe_files/jquery.js"></script>
- <script src="swipe_files/index.js"></script>
- <script src="swipe_files/jquery.mobile-1.4.2.min.js"></script>
- <script src="swipe_files/swipe-page.js"></script>
-
- </head>
- <body>
- <div id="header" data-role="header" data-id="header" data-position="fixed" data-fullscreen="true" data-tap-toggle="true">
- <h1>New York</h1>
- <a href="./" data-ajax="false" data-direction="reverse" data-icon="delete" data-iconpos="notext" data-shadow="false" data-icon-shadow="false">Back</a>
- </div><!-- /header -->
- <div data-role="page" id="newyork" class="demo-page" data-title="New York" data-dom-cache="true" data-theme="b" data-next="buenosaires">
- <div role="main" class="ui-content">
- <div id="trivia-newyork" class="trivia ui-content" data-role="popup" data-position-to="window" data-tolerance="50,30,30,30" data-theme="a">
- <a href="#" data-rel="back" class="ui-btn ui-btn-right ui-btn-b ui-btn-icon-notext ui-icon-delete ui-corner-all">Close</a>
- <p>Blah Blah Blah</small></p>
- </div>
- </div>
- <!-- /content -->
- <div class="tournament">
- <div class="portfolio-item-thumb one-half">
- <div class="round quarter-finals">
- <div class="match" >
- <div class="player">Five Finger Death Punch</div>
- <div class="player winner">Player 2</div>
- </div>
- <div class="match">
- <div class="player winner">Player 3</div>
- <div class="player">Player 4</div>
- </div>
- <div class="match">
- <div class="player">Player 5</div>
- <div class="player winner">Player 6</div>
- </div>
- <div class="match">
- <div class="player">Player 7</div>
- <div class="player">Player 8</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- /page -->
- <div id="footer" data-id="footer" data-position="fixed" data-fullscreen="true" data-tap-toggle="false">
- <div data-role="controlgroup" class="control ui-btn-left" data-type="horizontal" data-mini="true">
- <a href="#" class="prev ui-btn ui-btn-icon-notext ui-icon-carat-l">Previous</a>
- <a href="buenosaires.html" class="next ui-btn ui-btn-icon-notext ui-icon-carat-r">Next</a>
- </div>
- <a href="#trivia-newyork" id="trivia-button" data-rel="popup" class="trivia-btn ui-btn ui-btn-right ui-btn-icon-left ui-icon-info ui-mini ui-corner-all">Trivia</a>
- </div><!-- /footer -->
- </body>
- </html>
when the yellow highlighted code in the content is NOT there, everything works perfect.
When I add the highlighted code, I cant swipe anymore. It will swipe if i can grab a little bit of the background outside of that highlighted code area.
Any ideas why when I add that div content in there, it covers up the swipe ability?
just in case, here is the css as well...
- .demo-page {
- background-size: cover;
- background-position: center center;
- background-repeat: no-repeat;
- }
- .demo-page .ui-footer {
- background: #000;
- border: none;
- bottom: 0;
- }
- .control.ui-btn-left,
- .trivia-btn.ui-btn-right {
- top: auto;
- bottom: 7px;
- margin: 0;
- }
- small {
- font-size: .75em;
- color: #666;
- }
any suggestions would be awesome! Thanks
here is the non-working page...
to best see the issue, look on mobile,(it will swipe on browser with mouse if you grab the bg area)