当单击
<a>
标记,我想获取所述链接的文本值并将其放在另一个链接的内部
<div>
(
.current-selection
)在父级中。但是,我也需要
fadeOut()
家长允许这种变化在不可见的情况下发生,然后再将其带回来
fadeIn()
. 我可以让它单独工作,但在fadeout()函数中放置文本更改时不行。
下面的代码获取父级的文本,而不是最初单击的标记。像这样筑巢时我能做些什么呢?
谢谢您。
$('.filter').on( 'click', 'a', function() {
// Fadeout text to allow for hidden text change
$(this).parent.fadeOut(function() {
// Change text of the current selection to match the item just clicked (not working)
$('.filter').find('.current-selection').text($(this).text());
}).fadeIn();
});