zclip not work in jquery ui inactive tab

感情迁移 提交于 2019-12-10 19:02:06

问题


I am using zclip in my asp.net webpage on jQuery UI dialog in jQuery UI tab. It works great in first tab which is active but it doesn't work when I add it to second tab and click second tab and clip copy button.

my markup is below:

<input type="text" id="txtCallStatus" class="disabled" 
    readonly="readonly" value="NOT SET" />
<a href="#" id="copy-dynamic" onclick="return false;">Copy status</a> 

Js code is below:

$.ajax({
    type: "POST",
    dataType: "json",
    url: "/recording/verifyUser",
    data: {
        ID: $("#ID").val(),
        PSSWD: $("#PSSWD").val(),
        ACCID: $("#ACCID").val(),
        PASSWDINT: $("#PASSWDINT").val()
    },
    success: function (data) {
        if (data == "success") {

            $('#dialog-AddCallRecording').dialog({ closeOnEscape: false });

            $(".ui-dialog-titlebar").hide();
            $("#dialog-AddCallRecording").dialog({ 
                dialogClass: 'transparent', 
                modal: true 
            });
            $("#dialog-AddCallRecording").dialog("open");

            // The link with ID "copy-description" will copy
            // the text of the paragraph with ID "description"
            $('a#copy-dynamic').zclip({
                path: '../../Content/Zclip/ZeroClipboard.swf',
                copy: function () { return $('input#txtCallStatus').val(); }
            });

            // The link with ID "copy-dynamic" will copy the current value
            // of a dynamically changing input with the ID "dynamic"

        }
        else {
            $("#dialog-user-login").dialog('option', 'position', 'center');
            $("#dialog-user-login").dialog("open");
        }
    }
});

In success, after dialogue is open, I am initializing the zclip.

Please suggest solution to it. Thanks

来源:https://stackoverflow.com/questions/15087413/zclip-not-work-in-jquery-ui-inactive-tab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!