Baidu Editor: Upload image two

Source: Internet
Author: User
Tags button type

<! DOCTYPE html>"Ueditor.config.js"></script> <script src="Ueditor.all.min.js"></script> <script src="Lang/zh-cn/zh-cn.js"></script> <script src="Jquery-3.1.1.min.js"></script> <meta http-equiv= "Content-type" content= "text/html; charset=utf-8″> <style>/*Upload*/. up-box{margin:10px0; border:1px solid #eee; Min-height:220px; /*Display:none;*/}. up-box ul{padding:0px;} . Up-box li{width:120px; height:200px; float: Left; margin:10px;} . Up-Box Li img{width:120px; height:120px;        Overflow:hidden;} . Up-box. IMG Img{width: -%; vertical-Align:bottom;} . Up-box Li. input{margin:5px0; Width -%; border:1px solid #eee; padding:5px;} . Up-box li Delete{cursor:pointer; color: #eee}. up-box li. Delete:hover{color: #5cb85c}. Clearfix{clear:both}</style>"Button"onclick="upimage ()"> Upload </button><!--li pointer position--><input type=""Id="Li-pointer"Value="">"Thumb_str">[{"src":"\/ueditor\/php\/upload\/image\/20170526\/1495787497215115.jpg","title":"123","Top":1},{"src":"\/ueditor\/php\/upload\/image\/20170526\/1495789723119809.jpg","title":"undefined","Top":0}]</div><!--picture Display box--><divclass="Up-box Clearfix"> <ul id="Up-append"> </ul></div><!--hidden editor--><div id="Up_edit"style="Display:none;"title="Hidden Editor"></div></body><script>varup = Ue.geteditor ('Up_edit'); $ (document). Ready (function () {/*Initialize album content*/        //get album content and go to array format$thumb _str = $ ('#thumb_str'). text (); vararg = eval ('('+ $thumb _str +')');        Divshow (ARG); //Initialize pointer position$l = $ ("#up-append Li"). length; $("#li-pointer"). Val ($l);    }); //pop-up Picture upload dialog boxfunction Upimage () {varMyImage = Up.getdialog ("Insertimage");    Myimage.open (); }    //Monitor image uploadUp.addlistener ('Beforeinsertimage', Function (t,arg) {divshow (ARG);    }); //Picture Formatfunction Divshow (arr) {var$str ="'; //Array Length        var$arr _length =arr.length; //get the Li pointer position$length = Number ($ ("#li-pointer"). Val ());  for(i=0;i< $arr _length;i++){            //pointer length$ii = $length +i; //alert ($ii);$str + ="<li class= ' List_"+ $ii +"' >"; $str+="<input name= ' up-thumb[] ' id= ' up-thumb-"+i+"' type= ' hidden ' value= '"+arr[i].src+"' >"; $str+="<div class= ' img ' >"+arr[i].src+"'/></div>"; $str+="<input name= ' up-title[] ' id= ' up-title-"+i+"' value= '"+arr[i].title+"' class= ' input ' placeholder= ' please set the title ' >"            if(arr[i]['Top'] ==1) {$str+="<label class= ' pull-left ' ><input name= ' up-top ' type= ' Radio ' value= '"+ $ii +"' checked> set cover </label>"            }Else{$str+="<label class= ' pull-left ' ><input name= ' up-top ' type= ' Radio ' value= '"+ $ii +"'/> Set cover </label>"} $str+="<label class= ' pull-right ' class= ' delete ' ><a href= ' javascript:dele_list ("+ $ii +") ' > Delete </a> </label>"; $str+="</li>"; }        $("#up-append"). Append ($STR)//Regenerate pointer position$t = parseint ($length) +$arr _length; $("#li-pointer"). Val ($t); }    //Deletefunction Dele_list ($id) {$ (". List_"+$id). Remove (); }</script>

Baidu Editor: Upload image two

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.