简体   繁体   English

在iscroll4中同时使用useTransform:false和zoom:true,缩放不起作用

[英]using both useTransform:false and zoom:true in iscroll4, zooming is not working

this is my code, 这是我的代码,

var myScroll;

                                    function scroll() {

                                        myScroll = new iScroll('wrapper', {
                                                               checkDOMChanges: false,
                                                               useTransform: false,
                                                               onBeforeScrollStart: function (e) {
                                                               var target = e.target;
                                                               while (target.nodeType != 1) target = target.parentNode;

                                                               if (target.tagName != 'SELECT' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA')
                                                               e.preventDefault();
                                                               },
                                                               zoom: true


                                                               });
                                        setTimeout(function () { myScroll.refresh(); }, 0);

                                    }


                                    document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
                                    document.addEventListener('DOMContentLoaded', scroll);  

when i remove the useTransform:false line, zooming in iscroll is working.when i try the above code, zoom is not working. 当我删除useTransform:false行时,放大iscroll是有效的。当我尝试上述代码时,缩放不起作用。 but i need to use useTransform:false for certain operations in my application. 但是我需要对应用程序中的某些操作使用useTransform:false。 how to make work the zoom if i use useTransform:false line. 如果我使用useTransform:false行,如何使缩放工作。 pl help me. 请帮助我。

I'm not 100% sure but I'd assume iScroll needs to use transforms to zoom as it's using the transform: scale(x) property to emulate the zoom by scaling the content. 我不确定100%,但是我认为iScroll需要使用transform来缩放,因为它正在使用transform:scale(x)属性通过缩放内容来模拟缩放。

Therefore I don't think you'll be able to do this. 因此,我认为您将无法做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM