Jump to content
Fórum Script Brasil
  • 0

Copiar e colar imagem

Wellington Gallo


Boa tarde, esse codigo de copiar e colar imagem só roda no chrome , queria saber como posso adaptar para o ie e o firefox, é através do clipboardData né ? Mas como que eu faço isso ?

$(document).ready(function() {

            function processEvent(e) {
                for (var i = 0 ; i < e.clipboardData.items.length ; i++) {

                    // get the clipboard item
                    var clipboardItem = e.clipboardData.items[i];
                    var type = clipboardItem.type;

                    // if it's an image add it to the image field
                    if (type.indexOf("image") != -1) {

                        // get the image content and create an img dom element
                        var blob = clipboardItem.getAsFile();
                        var blobUrl = window.webkitURL.createObjectURL(blob);
                        var img = $("<img/>");

                        // our slider requires an li item.
                        var li = $("<li></li>");

                        // add the correct class and add the image

                        // add this image to the list of images

                        // reset the basic-slider added elements

                        // reset the image slider
                            height      : 320,
                            width       : 620,
                            responsive  : true
                    } else {
                        console.log("Not supported: " + type);

Edited by Wellington Gallo
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...