Ver código fonte

Only use nicescroll on a non-touch browser

Nathaniel van Diepen 11 anos atrás
pai
commit
a90132ecc6
2 arquivos alterados com 11 adições e 8 exclusões
  1. 1 0
      css/style.css
  2. 10 8
      js/index.js

+ 1 - 0
css/style.css

@@ -70,6 +70,7 @@ div#content{
 	width: 100%;
 	height: calc(100% - 35px);
 	-webkit-overflow-scrolling: touch;
+	overflow: auto;
 }
 div#loading{
 	width: 100%;

+ 10 - 8
js/index.js

@@ -224,14 +224,16 @@
 				flag('load',false);
 			});
 		},'json');
-		$('#content').niceScroll({
-			cursorwidth: 10,
-			nativeparentscrolling: false,
-			preservenativescrolling: false
-		});
-		document.addEventListener('touchmove',function(e){
-			e.preventDefault();
-		});
+		if(!$.support.touch){
+			$('#content').niceScroll({
+				cursorwidth: 10,
+				nativeparentscrolling: false,
+				preservenativescrolling: false
+			});
+			document.addEventListener('touchmove',function(e){
+				e.preventDefault();
+			});
+		}
 	});
 	$(window).resize(function(){
 		if($(window).width()>767){