Commit 7b59e20b by sunchao

ipad滑块

parent 093ea17b
...@@ -248,7 +248,7 @@ export class LoginComponent implements OnInit, OnDestroy { ...@@ -248,7 +248,7 @@ export class LoginComponent implements OnInit, OnDestroy {
*/ */
//滑块移动量 //滑块移动量
if(this.deviceType == 2 || this.deviceType == 3){ if(this.deviceType == 2 || this.deviceType == 3){
this.left = touch.clientX - this.dragHandler.nativeElement.clientWidth / 2; this.left = touch.clientX - this.dragHandler.nativeElement.clientWidth / 2 - this.len;
}else{ }else{
//获取滑块 //获取滑块
this.dragHandler.nativeElement = document.getElementsByClassName("slideController")[0]; this.dragHandler.nativeElement = document.getElementsByClassName("slideController")[0];
...@@ -257,7 +257,6 @@ export class LoginComponent implements OnInit, OnDestroy { ...@@ -257,7 +257,6 @@ export class LoginComponent implements OnInit, OnDestroy {
}else{ }else{
this.left = 0; this.left = 0;
} }
} }
if(this.left < 0) { if(this.left < 0) {
this.left = 0; this.left = 0;
......
...@@ -77,8 +77,7 @@ export class LifeCommonService { ...@@ -77,8 +77,7 @@ export class LifeCommonService {
*/ */
checkDeviceType() { checkDeviceType() {
let deviceType = null; let deviceType = null;
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) { if (/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)) {
if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) { if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
deviceType = '3'; deviceType = '3';
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment