我正在尝试修复工具栏,以便当有人在textAngular编辑器仍然可见的情况下向下滚动页面时,它始终可见(或者向下滚动编辑器本身)。

滚动时工具栏不再可见:

使用position: fixed只是将其固定在整个页面的顶部。
当textAngular指令在视图中时,我尝试使用以下jQuery来修复滚动:
$(document).load( function() {
var textEditor = $(".ta-root");
var toolbar = $(".ta-toolbar");
$(document).on("scroll", function(e) {
if (textEditor.offset().top < $(document).scrollTop() < textEditor.offset().top + textEditor.height() ) {
toolbar.css('position', 'fixed');
} else {
toolbar.css('position', 'static');
}
});
});然而,什么都没有发生。我不确定这是尝试改变angular指令行为的最好方法。有没有人知道我该怎么做?
发布于 2016-02-17 08:26:40
嘿,看看代码库中的demo/static-demo.html。它有一个静态工具栏的示例。
来自以下链接的回复:https://github.com/fraywing/textAngular/issues/697
https://stackoverflow.com/questions/34454881
复制相似问题