最代码官方的gravatar头像
最代码官方 2015-07-29 10:05:39

Android开发中在webview访问的html页面中添加js响应图片点击事件

web开发中,点击图片后弹出图层显示原图的特效有很多,但android开发中也有类似的功能,于是在csdn的博客中找到一篇文章实现了该功能的雏形,想要更多特效,比如多个图片间切换只需要增加一些代码即可实现。

开发环境:adt-bundle-windows-x86-20131030 Genymotion

源码截图:

Android开发中在webview访问的html页面中添加js响应图片点击事件

webview加载远程html文件后

Android开发中在webview访问的html页面中添加js响应图片点击事件

点击其中一个图片后

Android开发中在webview访问的html页面中添加js响应图片点击事件

gif动图

原文:http://blog.csdn.net/wangtingshuai/article/details/8635787


打赏

文件名:AndroidJavaScriptDemo.rar,文件大小:97.638K 下载
  • /
      • /AndroidJavaScriptDemo
        • /AndroidJavaScriptDemo/.classpath
        • /AndroidJavaScriptDemo/.project
        • /AndroidJavaScriptDemo/AndroidManifest.xml
          • /AndroidJavaScriptDemo/bin
            • /AndroidJavaScriptDemo/bin/AndroidJavaScriptDemo.apk
            • /AndroidJavaScriptDemo/bin/AndroidManifest.xml
              • /AndroidJavaScriptDemo/bin/classes
                  • /AndroidJavaScriptDemo/bin/classes/wst
                      • /AndroidJavaScriptDemo/bin/classes/wst/webview
                        • /AndroidJavaScriptDemo/bin/classes/wst/webview/BuildConfig.class
                        • /AndroidJavaScriptDemo/bin/classes/wst/webview/MainActivity$JavascriptInterface.class
                        • /AndroidJavaScriptDemo/bin/classes/wst/webview/MainActivity$MyWebViewClient.class
                        • /AndroidJavaScriptDemo/bin/classes/wst/webview/MainActivity.class
                        • /AndroidJavaScriptDemo/bin/classes/wst/webview/OnImageTouchedListener.class
最代码最近下载分享源代码列表最近下载
yzhqi520  LV1 2017年9月20日
Maybe  LV14 2016年12月2日
13232875251  LV14 2016年7月8日
好好如  LV3 2016年6月6日
浪子与孟子  LV9 2016年4月14日
hancy666  LV33 2016年4月10日
tinbe  LV11 2016年2月24日
daniel_gjg  LV25 2015年10月19日
孙永峰1994  LV8 2015年7月30日
guopeiyuan  LV10 2015年7月29日
最代码最近浏览分享源代码列表最近浏览
暂无贡献等级
yyyyyyzh  LV8 2023年6月11日
杜宇林  LV2 2023年5月30日
叙利亚葫芦娃12315646 2023年5月24日
暂无贡献等级
202105013142  LV1 2023年5月2日
qazfxh  LV1 2023年4月4日
史中杰 2022年12月21日
暂无贡献等级
666666777888  LV6 2022年11月2日
chaleur  LV1 2022年5月12日
学习指南  LV5 2022年5月10日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友