Baidu Ueditor Set default width height when uploading images

Source: Internet
Author: User
I also forced the dog, Baidu Editor organ document actually do very not detailed, are some basic usage, want to set an upload image default size can not find the corresponding document. In the elder brother's disdain diligently, finally is the disposition is good, actually is also very simple, adds a line of code ....

Find the editor root directory under the Ueditor.all.js, an open scare brother, tens of thousands of lines of code, but do not be afraid, search: Cllback () find this function

 function callback () {try{var link, json, loader, bo  DY = (Iframe.contentdocument | | iframe.contentWindow.document). Body, result = Body.innertext | | body.textcontent | |                        '';                        JSON = (new Function ("return" + result));                        link = me.options.imageUrlPrefix + json.url; if (json.state = = ' SUCCESS ' && json.url) {loader = Me.document.getElementById (loadingid                            );                            Loader.setattribute (' src ', link);                            Loader.setattribute (' _src ', link); Loader.setattribute (' title ', Json.title | | |                            ''); Loader.setattribute (' Alt ', json.original | |                            '');                            Loader.setattribute (' style ', ' max-width:650px ');//This is the code loader.removeattribute (' ID ') that the elder brother joins; DoMutils.removeclasses (loader, ' loadingclass '); }

Look at the comments section, in fact, to the IMG upload image price attributes on the line! You can arbitrarily add attributes, so willful, is so casual, passed by, learned to give Gozin a!!

The above describes the Baidu Ueditor upload images when the default width, including the content, I hope that the PHP tutorial interested friends have helped.

  • 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.