如何通过jquery或javascript将工具提示添加到元素? [英] how to add the tooltip to the element by jquery or javascript?
问题描述
我想添加一个提示-单击以复制到此站点的复制到剪贴板..."按钮( http://www.retailmenot.com/ [ ^ ]).黄色部分带有剪刀.但是当我使用jquery向其添加提示时.它不起作用.为什么?
我在此
上进行了测试
网站: http://bowser.effectgames.com/~jhuckaby/zeroclipboard/test10.html
i want to add a tip----click to copy to the Copy To Clipboard... button like this site(http://www.retailmenot.com/[^]). the yellow part with a Scissor. but when i using jquery to add a tip to it. it doesn''t work. why?
i test it on this
site:http://bowser.effectgames.com/~jhuckaby/zeroclipboard/test10.html
$(document).ready(function(){
$("#d_clip_container").hover(
function () {
$(this).append($(''<span class="tip">click to copy</span>''));
},
function () {
$(this).find("span:last").remove();
});
})
我已经添加了jQuery库.工具提示无法正常工作的原因可能是复制的文字已被Flash换行,但是此站点(retailmenot.com)可以.我不知道为什么?
有人帮忙吗?
i have added the jquery library. The reason the tooltip can''t work maybe the copied text is wrapped by the flash, but this site (retailmenot.com) can do. i don''t know why?
anyone helps?
推荐答案
(document).ready(function(){
(document).ready(function(){
(#d_clip_container").hover( 函数(){
("#d_clip_container").hover( function () {
(this).append(
(this).append(
这篇关于如何通过jquery或javascript将工具提示添加到元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!