图像放大流星android cordova [英] image zoom in meteor android cordova

查看:124
本文介绍了图像放大流星android cordova的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Meteor for Android构建聊天应用程序。我使用cordova相机插件包含了添加图像选项。现在,在图像上传并被用户看到之后,我想点击它并进行缩放。怎么办?

I am building a chat application using Meteor for Android. I have included "Add Image" option using cordova camera plugin. Now, after the image is uploaded and is seen by the users, I want to click on it and zoom it. How to proceed?

这是我的图像渲染代码:

Here's my image rendering code :

<div class="message">
     <img src="{{t.img}}" 
         data-action="zoom" 
         class="showImage" 
     >
</div>

我尝试过使用 inno:zoom 包但但没有成功。任何见解?

I've tried using the inno:zoom package but was unsuccessful. Any insights?

在html头中,我有以下代码:

In the html head, i have the following code :

 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=1">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">


推荐答案

我建议使用像Hammerjs这样的触摸库: http://hammerjs.github.io/

I’d suggest using a touch library such as Hammerjs: http://hammerjs.github.io/

有许多方法可以在JavaScript中使用touch,但如果您没有使用它们,则可能会很困难。

There are a lot of ways to work with touch in JavaScript, but they can be difficult if you aren’t experienced with them.

您可能需要放置上传的图像在其自己的模板中,并使用反应变量重新初始化图像元素,以实现缩放功能。对于您已尝试过的软件包,情况也是如此。

You may have to put the uploaded image in its own template and use reactive variables to re-initialize the image element in order to enact the zoom feature. This is likely also true of the package you already tried.

如果您可以共享更多代码示例,我(或其他人)可能会提供更具体的答案。

If you could share more code samples, I (or others) might be able to give a more specific answer.

这篇关于图像放大流星android cordova的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆