在iOS上测试崩溃,iphone4s,安卓正常,代码如下:
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/> <meta name="format-detection" content="telephone=no,email=no,date=no,address=no"> <link rel="stylesheet" type="text/css" href="../css/api.css" /> <style> img { width: 100px; height: 100px; margin-bottom: 10px; } </style> </head> <body> <div class="images"> <img src="http://xy**.**/uploadfile/images/20151229163941524650.jpg"/> <img src="http://xy**.**/uploadfile/images/20160113152615529271.jpg"/> <img src="http://xy**.**/uploadfile/images/20160113175420031180.jpg"/> </div> </body> <script type="text/javascript" src="../script/api.js"></script> <script type="text/javascript" src="../script/jquery-1.9.1.js"></script> <script type="text/javascript"> $(function() { apiready = function() { }; $('img').on('click', function() { var img = $(this); var imgs = $(this).parent().find('img'); var imgs_src = new Array(); var cur_idx = imgs.index(img); $(imgs).each(function() { imgs_src.push($(this).attr('src')); }); var photoBrowser = api.require('photoBrowser'); photoBrowser.open({ images: imgs_src, activeIndex: cur_idx, placeholderImg: 'widget://html/images/tx.png', bgColor: '#000' }, function(ret){
}); }); }); </script> </html>
|