我正在使用jQuery来制作滑动功能。当<div>
元素向上滑动时,由于命令overflow:auto
而出现滚动条,当文本溢出<div>
时,该命令会创建滚动条。但是,在滑动的情况下,我不希望这种情况发生。
当用户切换内容上下滑动时,如何停止显示滚动条?
答案 0 :(得分:0)
private void switchCameras() {
mCameraOpenCloseLock.release();
mCameraDevice.close();
CameraManager mCameraManager = (CameraManager) getActivity().getSystemService(Context.CAMERA_SERVICE);
try {
String mCameraId = mCameraManager.getCameraIdList()[0];
if (mCameraId.equals("0")) { // If currently on FRONT camera (0 = CameraCharacteristics.LENS_FACING_FRONT)
mCameraId = "1"; // switch to BACK camera (1 = CameraCharacteristics.LENS_FACING_BACK)
switchCameraButton.setImageResource(R.drawable.ic_camera_front);
} else { // If currently on BACK camera
mCameraId = "0"; // switch to front camera
switchCameraButton.setImageResource(R.drawable.ic_camera_back);
}
try {
if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.CAMERA)
== PackageManager.PERMISSION_GRANTED) {
mCameraManager.openCamera(mCameraId, mStateCallback, null);
} else {
requestVideoPermissions();
}
} catch (CameraAccessException e) {
e.printStackTrace();
}
} catch (CameraAccessException e) {
Toast.makeText(getActivity(), "Cannot access the camera.", Toast.LENGTH_SHORT).show();
getActivity().finish();
}
}
来设置溢出为无,并在操作结束时写入$(element).css('overflow', 'none')
再次返回。