- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 zclip 页面提供的干净示例代码:
$('a#copy-dynamic').zclip({
path:'js/ZeroClipboard.swf',
copy:function(){return $('input#dynamic').val();}
});
这是 HTML:
<a href="#" id="copy-dynamic" class="">Click here to copy the value of this input:</a>
<input type="text" id="dynamic" value="Insert any text here." onfocus="if(this.value=='Insert any text here.'){this.value=''}" onblur="if(this.value==''){this.value='Insert any text here.'}">
如果 HTML 位于 bootstrap 主页面内,它工作正常,但如果我将 html 移动到 bootstrap 模态窗口内(即模态的 div 元素内),它将停止工作。
我怎样才能让它工作?
最佳答案
我在使用 zclip 和 bootstrap 模态时遇到了同样的问题。我应用的修复是双重的:
这会将 zclip 正确地放置在模态中。如果您在模式中有多个选项卡,它也适用。
HTML
<div id="myModal" class="modal hide fade">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<a class="btn" href="#" id="modal_body_button">Copy Undo Config To Clipboard</a>
<p>One fine body…</p>
</div>
<div class="modal-footer">
<a href="#" class="btn">Close</a>
<a href="#" class="btn btn-primary">Save changes</a>
</div>
</div>
JavaScript
$('#myModal').on('show', function () {
$("#modal_body_button").delay(250).queue(function(next){
$(this).zclip({
path: "/static/javascript/ZeroClipboard.swf",
copy: "copied text OK!"
});
next();
});
});
关于javascript - zclip 在 bootstrap 模态中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14281373/
将 .zclip() 附加到按钮,然后触发它,然后删除 .zclip() 的最佳方法是什么?这听起来很简单,但我无法让它合作。我有一个包含许多按钮的页面,一些可以直接访问,一些按钮可以通过各种 Acc
我把示例代码放在这里 http://jsfiddle.net/8epWm/2/ 我想在表格内的元素上启用 zClip,但它不起作用。有什么想法吗? 最佳答案 表格元素在绝对定位方面存在问题,而 zCl
我正在尝试实现 zclip 以将输入的内容复制到剪贴板。页面上有 20 个文本输入,如下所示: 然后我想出了这个 jQuery 代码: jQuery(function() { jQuery("
http://jsfiddle.net/w4eL7/1/ 它在我的情况下不起作用,因为我的复制处理程序复制ID最初是隐藏的,并且zClip检查隐藏元素 if (o.is(':visible') &&
我正在使用名为 zclip 的 jquery 插件,它使用 swf 文件将字符串复制到 Clipbvoard。 我让 zclip 可以与我的网站配合使用,但我需要使用 ajax 来自另一个页面的字符串
我希望能够使用它附带的复制按钮复制类属性的值。 由于缺乏更好的措辞,这里有一个例子: 目前复制按钮仅适用于一个复制按钮(以先到者为准)。 如何使用多个按钮从多个元素进行复制? 代码: $(
jJuery zclip 在第一次点击时不起作用。第二次点击就可以了吗? function initiateCopy(){ $("a#copyDetails").zclip
我已经意识到我在 JS/jQuery 方面有多糟糕,几十年来一直没有使用它。 我正在使用 jQuery Zclip从列表中复制文本。但我发现它首先只适用于每页的一个元素。我找到了一个为每个列表项使用不
我知道它甚至可以在这个网站上工作,但只有当我通过 h1 元素触发它时,我需要通过图像(代表副本)触发它,但是当我尝试时它根本不起作用。这是我的 Javascript: $('#copyTxt').cl
我尝试复制到剪贴板按钮,但我不知道为什么我做不到。我使用 ajax 加载页面,因此当我将鼠标悬停在按钮上时,我调用一个函数将 zclip 添加到我的按钮。但当我点击它时,什么也没有发生。这是我的代码:
我正在尝试使用 Knockoutjs 创建一个具有动态加载文本的网站,我希望用户能够单击该网站并将其复制到剪贴板。对于复制到剪贴板功能,我使用 Zclip当文本静态加载时我可以让它工作。 在我的 Vi
我已经设置了链接,单击该链接时我希望它复制文本。它输出许多链接,因此我必须确保 zClip 复制正确的链接: " href="#"> 这是我正在使用的 jQuery,但它不起作用: $(documen
不知道为什么我的下面的单击不起作用,它需要两次单击才能复制。 $(document).ready(function() { $('#c
我正在使用 zclip 页面提供的干净示例代码: $('a#copy-dynamic').zclip({ path:'js/ZeroClipboard.swf', copy:funct
我正在尝试修改此输出; 我想将 snippet-clipboard 类的高度从 20px 更改为 30px 但我似乎做不到,我假设它在 jquery.zclip.js ( link ) 中。 如果有
如果跨浏览器无法完成此操作,那么任何评论将不胜感激。 我想要实现的是我的页面上有多个“复制到剪贴板”链接,例如这样...... " class="copy">Copy Original Link "
这很奇怪:: Jsfiddle : http://jsfiddle.net/sxeCM/4/ [ Working ] 本地有相同的代码:
我目前正在使用 zclip/jquery 代码来允许复制到剪贴板。它目前连接到一个跨度按钮。它似乎在按钮上使用 swf 文件来提供基于 Flash 的复制到剪贴板功能。我遇到的问题是,当我向页面动态添
我正在使用 zClip在我的网站上复制文本框中的几件东西,我让一切正常,但现在,没有改变任何东西,它停止工作。 原因是文件的主机ZeroClipboard.swf已删除该文件或由于某种原因使其无法访问
谁能告诉我为什么这段代码不起作用? 链接到 zclip:http://www.steamdev.com/zclip/ 工作示例:http://jsfiddle.net/f4gZA/ 提前致谢。
我是一名优秀的程序员,十分优秀!