我目前有一个持有按钮的引导弹出窗口。弹出窗口仅在鼠标位于表格的tr
上时显示。从弹出窗口访问表格行
我想要做的就是能够访问该行的元素,这是可能的。
酥料饼代码:
$('.popup').popover(
{
placement: 'top',
trigger: 'manual',
delay: { show: 350, hide: 100 },
html: true,
content: $('#shortcuts').html(),
title: "Quick Tasks"
}
).parent().delegate('#quickDeleteBtn', 'click', function() {
alert($(this).closest('tr').children('td').text()); // ???
});
var timer,
popover_parent;
function hidePopover(elem) {
$(elem).popover('hide');
}
$('.popup').hover(
function() {
var self = this;
clearTimeout(timer);
$('.popover').hide(); //Hide any open popovers on other elements.
popover_parent = self
//$('.popup').attr("data-content","WOOHOOOO!");
$(self).popover('show');
},
function() {
var self = this;
timer = setTimeout(function(){hidePopover(self)},250);
});
$(document).on({
mouseenter: function() {
clearTimeout(timer);
},
mouseleave: function() {
var self = this;
timer = setTimeout(function(){hidePopover(popover_parent)},250);
}
}, '.popover');
HTML:
<div class="hide" id="shortcuts">
<a href="javascript:void(0);" id="quickDeleteBtn" class="btn btn-danger">Delete</a>
</div>
的JavaScript在行实现酥料饼:
rows += '<tr class="popup datarow" rel="popover">';
有谁知道我做错了什么,我怎么我应该访问我徘徊在的tr
的子元素?
的jsfiddle:http://jsfiddle.net/C5BjY/8/
您可以为此创建的jsfiddle增加了容器的选择吗? – SaurabhLP
我在我的问题中包含了一个小提琴,http://jsfiddle.net/C5BjY/8/ –