Web Call Mobile album, and realize the dynamic increase of picture function

Source: Internet
Author: User

Note: The test H5 call album effect has compatibility issues, Android can only call the camera function (some Android may not be able to tune up, so it is recommended to use the app native call), iOS can adjust the photo and album features.
"http://www.w3.org/1999/xhtml"> "Content-type"Content="text/html; Charset=utf-8"/> <title> Untitled documents </title> <style type="Text/css">. role_info {margin-bottom:30px;}.    Role_info label {display:block; Font-size:24px; Color: #333;}. Role_info Input {width: -%; Margin-top:30px; Font-size:26px; Color: #999; Padding-bottom:15px; Border-bottom:1px solid #F3F3F3;}.     Upload_img. img{position:relative;} . close{Z-index:666; Font-size:30px; Right:0;    width:24px;    height:24px; Background: #000000; Opacity:0.4;    Color: #ffffff; Line-height:24px; float: Right; Position:absolute;}</style> 'upload_user_img'> <divclass="Role_info"> <label for="Product_force" class="Border_left"> Upload Data </label> <divclass="upload_img"> <divclass="img Cimg_0"Id="upload_btn"> <labelclass="Limg_0"> "Images/upload_img.png" class='Img_view_0'Mtype='1'/> <inputclass="Icimg_0"Name="Files"Type="file"accept="image/*"Value=""Capture="Camera"Onchange="xmtanuploadimg (this,0)"style="Opacity:0;visibility:collapse;"/> </label> </div> </div> </div> </f Orm></body> <script src="Https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script><script type="Text/javascript">//Select picture, preview nowfunction xmtanuploadimg (obj,key) {varFile = obj.files[0]; varReader =NewFileReader (); Console.log ('src:', This); //read File procedure methodReader.onloadstart =function (e) {Console.log ("start reading ...."); } reader.onprogress=function (e) {Console.log ("reading in progress ...."); } reader.onabort=function (e) {Console.log ("interrupt read ...."); } reader.onerror=function (e) {Console.log ("Read exception ...."); } reader.onload=function (e) {Console.log ("successfully read ...."); $('. Img_view_'+key). attr ('src', E.target.result); varImg_mytype = $ ('. Img_view_'+key). attr ('Mtype'); $('. Icimg_'+key). attr ('name','Files'); $('. Limg_'+key). Before ('<span class= "Close" onclick= "del_img (\ ' Cimg_'+key+'\ ') ' >x</span>'); if(Img_mytype = =1){            $('. Img_view_'+key). attr ('Mtype',2); varKeyr = key+1; Console.log ('Keyr:'+Keyr); varImgstr ='<div class= "img cimg_'+keyr+'">'+'<label class= "Limg_'+keyr+'">'+keyr+'"mtype=" 1 "/>'+'<input class= "Icimg_'+keyr+'"name=" Files "type=" file "accept=" image/* "value=" "capture=" Camera "onchange=" xmtanuploadimg (This,'+keyr+') "style=" opacity:0;visibility:collapse; "/>'+'</label></div>'; $('. Cimg_'+key). After (IMGSTR); }} reader.readasdataurl (file)}</script> 

Web Call Mobile album, and realize the dynamic increase of picture function

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.