Search code examples
jqueryzclip

Using ZClip with Live in Jquery (for modal window)


I am using the flowplayer overlay tool to load a div in a modal window. Any suggestions on getting zClip (or something comprable) to work? This is the closest I have gotten:

 var cc = jQuery.noConflict();
 cc('#WOTW').ready(function() {
    cc('#codeButton').live('click', function() {
        cc('#codeButton').zclip({
            path: '/site/js/ZeroClipboard.swf',
            copy: cc('#copyCode').text(),
            afterCopy: function() {
                cc(this).next('.check').fadeIn();
            }
        });
    });
});

This works but ONLY on the second click... Which I find very odd. help?


Solution

  • Take advantage of the 'open' and 'close' parameters in Jquery UI dialogs to simulate the modal behavior. Try this:

    http://jsfiddle.net/samdel/mmkMZ/14/