[英]iScroll.js and iOS browser detection - show the iScroll.js file only to iPad/iPhone
[英]Enabling pinch zoom on iOS when using iScroll.js
我正在使用iScroll.js构建一个页面可滚动的Web应用程序,无论我做什么,我都无法使其内置的缩放功能正常工作。 我包含了iscroll-zoom.js文件,但仍然没有成功。
我在文件的开头有这个:
<script src="js/iscroll.js"></script>
<script src="js/iscroll-zoom.js"></script>
<script src="js/iscroll-probe.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
这个脚本:
function loaded () {
myScroll = new IScroll('#wrapper', {
mouseWheel: true,
zoom: true,
bounce: false
});
根据iScroll文档,这应该可以,但是不能。 如果有帮助,我需要在iPad上运行它。
function createZoomForID (id) {
$timeout(function(){
var wrapper = document.getElementById(id);
var myScroll = new IScrollZ(wrapper, {
zoom: true,
zoomMin: 1,
zoomMax: 4,
scrollX: true,
scrollY: true,
mouseWheel: true,
freeScroll: true,
wheelAction: 'zoom',
});
$scope[id] = myScroll;
}, 125);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.