Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Demos: fixed the prevent page scrolling when scrolling source view.

  • Loading branch information...
commit 9cafeb1802c1c3020e4025f29aff4b3cd47a196e 1 parent c7848f9
@jaspermdegroot jaspermdegroot authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 docs/demos/_assets/js/jqm-demos.js
View
12 docs/demos/_assets/js/jqm-demos.js
@@ -158,14 +158,14 @@ $( document ).on( "pagebeforecreate", "[data-role='page']", function() {
$( document ).on( "pageinit", function( e ) {
// prevent page scroll while scrolling source code
- $( ".jqm-demo .ui-collapsible-content" ).on( "mousewheel", function( e, d ) {
- if ( d > 0 && $( this ).scrollTop() == 0 ) {
- e.preventDefault();
- } else if ( d < 0 && $( this ).scrollTop() == $( this ).get(0).scrollHeight - $( this ).innerHeight() ) {
- e.preventDefault();
+ $( document ).on( "mousewheel", ".jqm-demo .ui-collapsible-content", function( event, delta ) {
+ if ( delta > 0 && $( this ).scrollTop() === 0 ) {
+ event.preventDefault();
+ } else if ( delta < 0 && $( this ).scrollTop() === $( this ).get( 0 ).scrollHeight - $( this ).innerHeight() ) {
+ event.preventDefault();
}
});
-
+
// reposition when switching between html / js / css
$( e.target ).delegate( ".jqm-demo .ui-collapsible", "expand", function() {
$( this ).parents( ".jqm-demo" ).trigger( "resize" );
Please sign in to comment.
Something went wrong with that request. Please try again.