点击图像时,如何禁用phonegap/cordova上的图像缩放



我有一个phonegap/cordova应用程序,它可以从wordpress网站上提取博客文章。然而,我有一个问题,当点击页面上的图像时,它会打开全屏,从而隐藏应用程序的导航。这种行为并不理想,因为用户必须退出应用程序并重新打开它才能取回导航控件。

以下是使用iOS模拟器的行为截图:https://i.stack.imgur.com/iLl4H.jpg

这种行为也发生在iPadAir2上。

有没有办法在phonegap/cordova中禁用这种行为?

代码的格式如下:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="attachment_38739" style="width: 310px" class="wp-caption alignright"><a href="http://unfspinnaker.com/wp-content/uploads/2015/02/BodyFound_GarrettMilanovich_3.jpg" class="ui-link"><img class="wp-image-38739 size-medium" src="http://unfspinnaker.com/wp-content/uploads/2015/02/BodyFound_GarrettMilanovich_3-300x200.jpg" alt="The body will be sent to the medical examiner’s office for further investigation.    Photo by Garrett Milanovich " width="300" height="200"></a><p class="wp-caption-text">The body will be sent to the medical examiner’s office for further investigation. <br> <em> Photo by Garrett Milanovich </em></p></div>
以下jquery修复了该问题:
$(document).ready(function(){
			  $('.ui-link').click(function(e) {
    			e.preventDefault();
			  });
});

在HTML页面中使用元标记应该可以解决这个问题。

<meta name="viewport" content="user-scalable=no" />

最新更新