JS How to get all the images

Click a picture in the web page, the picture can zoom in, and can switch the picture in order, and some small icons and pictures that do not meet the requirements cannot be enlarged. .
Since the web page is open in the app, the amplification and switching of the image is implemented by the mobile terminal, so it is necessary to call the native method with JS, and pass all the images URL

solve

VAR IMG = []; for (var i = 0; i
 20) {IMG [i] = $ ("img"). EQ (i) .attr ("src");}} var IMG_INFO = {}; img_info.list = img; // Save all images URLVAR IMGS = Document.getElementsBytagname ('IMG'); for (var i = 0; i  20) {// Store $ (IMGS [i]). Attr ('INDEX', I); $ (IMGS [i]); $ (IMGS [i]); $ (IMGS [I)). Click () {// Get The index of the picture stored above, this index is the current picture index IMG_INFO.Index = $ (this) .attr ('index'); // Transform information to JSON string var json = json.stringify (IMG_INFO); / / Judgment is the iOS terminal or Android end IF (_ios ()) {WINDOW.WEBKIT.MESSAGEHANDLERS.SHOWIMG.POSTMESSAGE (JSON);} else f (_isandroid ()) {WiNdow.control.call ('Showimg', JSON);}});}}   The above is all the content of this article, I hope to help everyone's learning, I also hope that everyone will support Tumi Clouds.  
© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment