悬停功能为警报工作,但不能附加span标签
Hover functionality working for alert but not able to append the span tag
悬停功能可用于显示警报,但是我不能用span标签显示附加的文本我不知道这是怎么回事。下面提供我的代码:
$('document').ready(function () {
window.setTimeout(function () {
$('.cubeCell').each(function () {
var htmlText = $(this).attr('data-text');
$(this).append('<div class="cubeTextStyle">' + htmlText + '</div>');
$(this).hover(
function () {
//alert("123");
$(this).append($("<span> ***</span>"));
},
function () {
$(this).find("span:last").remove();
});
});
}, 600);
});
<div class="cubeCell"
data-text="hover here"
class="desktopContactImage cubeCell"
data-caption="<a style='padding-left: 40px; font-size: 14px; color: grey;' href='/Inventory/Partnumber/?ps=list' >Register</a> <div> <a style='padding-left: 40px; font-size: 14px; color: grey;' href='/Bom/Bom/?ps=list' >Demo</a> </div> <a style='padding-left: 40px; font-size: 14px; color: grey;' >Reports</a>"
data-image="http://intra.defie.co/images/Desktop_icons_02.07.13/guest.png"
></div>
我对标记不太了解也不知道你是如何实现旋转框的但我想知道你是否想在cubeStyleText旁边显示文本因为你在悬停时将span添加到同一位置但它显示在框的后面如果是这样的话,而不是
$(this).append($("<span> ***</span>"));
使用这个
$(this).children(".cubeTextStyle").append($("<span> ***</span>"));
这似乎解决了定位问题,如果它是。
相关文章:
- JS可以在Chrome中工作,但不能在Firefox中工作
- WebRTC视频聊天可以在FF中使用,但不能在Chrome中使用
- jQuery Datepicker可以在Safari中工作,但不能在FF或Chrome中工作
- 三角库可以与firefox一起使用,但不能在Chrome中使用
- Highcharts可以从服务器加载数据,但不能更新
- 刷新GoogleMaps tile服务器可以使用JavaScript,但不能使用GWT
- node.js可以识别字符模式,但不能识别数字模式
- 如何在元素中处理鼠标事件,但不能在其子元素上处理
- Json到CSV下载,可以在chrome中工作,但不能在IE浏览器中工作
- jQuery$.post可以在chrome、safari中工作,但不能在FF中工作(声明成功回调函数未定义)
- Javascript可以在chrome中使用,但不能在其他浏览器中使用
- Iframe加载调整大小在Chrome中工作,但不能在IE或Firefox中工作
- Rails Production-可以工作,但不能编辑/删除/创建记录
- 能够在Highcharts中看到值,但不能看到图形
- Django,HTML,JS:<img src=“#">可以在HTML中工作,但不能在JS文件中工作
- 通过Javascript SDK登录Facebook可以在移动设备和本地主机上使用,但不能在台式机上使用
- jQuery/Javascript函数可以在Chrome中使用,但不能在IE11中使用
- 可以将模型传播到组件,但不能传播到sap.ui.jsfragment
- 悬停功能为警报工作,但不能附加span标签
- Jquery使用.text()可以改变bootstrap类的第一个span,但不能改变第二个span