Вопрос

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