[英]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.