1

这是我的代码:

JavaScription:

<script src="/assets/lessons/js/ZeroClipboard.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function(){
        clip = new ZeroClipboard.Client();
        clip.setText( '' );
        clip.glue('copy_text_button');
        clip.addEventListener('mouseDown', function() {
            clip.setText($('.modal-pane:visible').text());
        });
    });
</script>

HTML:

<div class="modal-pane">
                    <?= $json->parent_connection->english ?>
                    <?php if(isset($sponsor_content->english)): ?>
                        <p><?= $sponsor_content->english ?></p>
                    <?php endif; ?>
                </div>
<nav class="modal-nav">
                <a href="#" class="modal-btn-close"></a>
                <a href="#" class="modal-btn-english modal-tab">ENG</a>
                <a href="#" class="modal-btn-spanish modal-tab">ESP</a>
                <a href="#" class="modal-btn-copy" id="copy_text_button">Copy Text</a>
            </nav>

由于某种原因它不起作用,我没有收到任何错误消息......知道为什么会这样吗?

4

0 回答 0