I have a wordpress site. I want to add a copy to clipboard button in all post in a listing. In post, the copy to clipboard is included in ajax loaded content. Zclip is working fine in normal content, not in ajax content.

有帮助吗?

解决方案

example code

jQuery('.ajax_area').load('ajax_test_file.php', function() {
                jQuery('a.copy-description').zclip({
                path: '<?php bloginfo('template_url'); ?>/js/ZeroClipboard.swf',
                copy: function() {
                    return jQuery(this).find('p.description:first').text();
                }
            });
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top