Domanda

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.

È stato utile?

Soluzione

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();
                }
            });
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top