The jquery plugin that implements picture pasting in the browser--pasteimg use guide _jquery

Source: Internet
Author: User

Pasteimg is a jquery plugin that can be pasted in a browser, compatible with Chrome, Firefox, IE11, and other browsers that use these kernels, such as the famous 360 browsers in the country.

Pasteimg can recognize pictures that are copied directly in the browser, or you can identify the pictures in the copied rich text. You can only identify what is copied in the browser, and the images copied in the operating system are not recognizable.

Pasteimg relies on jquery, easy to use, and after introducing jquery and Paste.image.js, the invocation is as follows:

Copy Code code as follows:

Call the Pasteimage method on a DOM element that requires listening on the pasted event
Calling the Pasteimage method requires passing in a callback parameter
Once you have found the picture in the pasted content, you will call callback
When you call callback, you pass in an array that contains all the pictures
This plugin will be as much as possible to convert the picture to Base64 encoding, but subject to cross-domain restrictions, if not converted, will return the absolute URL path of the picture
$ ("#container"). Pasteimage (function (IMGs) {
IMGs is array so contain all image, can do something ...
});


Plugin Download Address: https://github.com/iyangyuan/pasteimg

There are questions welcome feedback!

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.