当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - android webview image in overflow div not draggable if it has links on it

问题描述:

I have an android app that uses webview to render large images in a div. The div has fixed width height to match the screen leaving some area on top for controls. The image has an image-map on it and areas created with links.

Now the issue is that when I drag the image from non-mapped areas, it works fine, but when I drag from mapped area, it does not work and I think stucks in the touch event (because I also see the orange focus border on the image map area that opens links).

This happens only when the page is run from within app+webview, but if I load the page in browser on same mobile, it works fine.

Also this does not happen in my Android 5.1 Vega IRON, but it happens in older phones like Android 4.4 Droid, and same version Huawei.

Is this some known issue?

This might have something to do with touch events in application, as it works in browser but not in application.

网友答案:

I found out that in some conditions, the image-map does not let the mouse button events go past, therefore it does not perform even the default dragging and click behavior.

I had to remove image-map and build my own absolute positioned and display:block <a> tags for each area, and then it worked.

Hope this helps someone.

分享给朋友:
您可能感兴趣的文章:
随机阅读: