小编Jus*_*ank的帖子

CSS位置元素在滚动容器内"固定"

我想知道是否有人为此找到了解决方案?

我正在寻找一个解决方案,将元素附加到滚动容器的顶部

HTML:

<div class="container">
  <div class="header">title</div>
  <div class="element">......</div>
  ... (about 10-20 elements) ...
  <div class="element">......</div> 
</div>
Run Code Online (Sandbox Code Playgroud)

所有"元素"都有position:relative,

容器有以下CSS:

.container {
  position:relative;
  width:200px;
  height:400px;
  overflow-y:scroll;
}
Run Code Online (Sandbox Code Playgroud)

我希望标题保持在容器的顶部,独立于其滚动位置和滚动在下面的元素.

到目前为止的CSS:

.header {
  position:absolute; /* scrolling out of view :-( */
  z-index:2;
  background-color:#fff;
}
.element{
  position: relative;
}
Run Code Online (Sandbox Code Playgroud)

所有元素都是块元素,我不能将标题移动到容器之外.jquery在这一点上是没有选择的.

html css position

28
推荐指数
4
解决办法
5万
查看次数

Emacs init.el文件无法加载

当我打开emacs时,*Messages*缓冲区中会出现以下消息,并且我的init.el文件(位于~/.emacs.d/init.el)不会加载.

Loading 00debian-vars...done
Loading /etc/emacs/site-start.d/50cedet-common.el (source)...
Error while loading 50cedet-common: Cannot open load file: cedet-autogen
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
Loading /etc/emacs/site-start.d/50haskell-mode.el (source)...
Loading /usr/share/emacs/site-lisp/haskell-mode/haskell-site-file.el (source)...done
Loading /etc/emacs/site-start.d/50haskell-mode.el (source)...done
Loading /etc/emacs/site-start.d/50php-elisp.el (source)...done
Loading /etc/emacs/site-start.d/51speedbar.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.   
Run Code Online (Sandbox Code Playgroud)

当我谷歌搜索或查看emacs wiki时,我找不到有关cedet的任何有用信息.奇怪的是,当我使用M-x eval-bufferM-x load-file,一切正常.HOME应该是什么,我正在运行版本23.3.1.

在发生这种情况之前,我一直试图让jshint使用emacs,尽管我不确定这是否与所有相关的https://github.com/daleharvey/jshint-mode有关.

emacs init

14
推荐指数
1
解决办法
1万
查看次数

从ansible使用模块包时如何更新包缓存

如果我运行 apt,我可以更新包缓存:

apt:
  name: postgresql
  state: present
  update_cache: yes
Run Code Online (Sandbox Code Playgroud)

我现在正在尝试使用通用package命令,但我看不到这样做的方法。

package:
  name: postgresql
  state: present
Run Code Online (Sandbox Code Playgroud)

我是否必须运行显式命令才能运行apt-get update,还是可以使用包模块执行此操作?

package-managers ansible

9
推荐指数
3
解决办法
2904
查看次数

Eclipse:在块中查找可能引发异常的行

我正在查看看起来像的代码

try {
     // Lots of things here.
     // More than I'd like to individually hover over every time I see this
} 
catch (Exception e) {
     // doesn't matter
}
Run Code Online (Sandbox Code Playgroud)

对于 try 块中的任何特定方法,我可以找到它抛出的已检查异常。有什么方法可以突出显示所有可能引发某些已检查异常的行吗?

一般来说,我想我也许可以删除 catch 块,将方法签名更改为抛出异常,此时,我可以看到方法中抛出异常的所有行(没关系:查看更新)。

在这种情况下,这甚至不会很好地工作,因为代码在 JSP 中。

注意:如果重要的话,我使用的是 MyEclipse 标准。

更新:标记事件已开启,但在这种情况下根本不执行任何操作。我问这个问题是因为我认为有关上下文的某些东西导致了这种预期的行为,但它看起来像是一个奇怪的边缘情况或错误。

java eclipse jsp exception

5
推荐指数
1
解决办法
4653
查看次数

是否可以创建一个引用惰性静态值的向量?

以下代码编译:

let x = Regex::new(r"\d+").unwrap();
let y = Regex::new(r"asdf\d+").unwrap();
let regexes = vec![x, y];
Run Code Online (Sandbox Code Playgroud)

但是这段代码没有:

lazy_static! {
    static ref X_PRIME: Regex = Regex::new(r"\d+").unwrap();
    static ref Y_PRIME: Regex = Regex::new(r"asdf\d+").unwrap();
}
let regexes = vec![X_PRIME, Y_PRIME];
Run Code Online (Sandbox Code Playgroud)

错误是:

error[E0308]: mismatched types
  --> src\syntax\lex.rs:19:33
   |
19 |     let regexes = vec![X_PRIME, Y_PRIME];
   |                                 ^^^^^^^ expected struct `syntax::lex::lex::X_PRIME`, found struct `syntax::lex::lex::Y_PRIME`
   |
   = note: expected type `syntax::lex::lex::X_PRIME`
   = note:    found type `syntax::lex::lex::Y_PRIME`
Run Code Online (Sandbox Code Playgroud)

static vector rust

3
推荐指数
1
解决办法
307
查看次数

YesodAuthEmail 无法推断 m ~ HandlerFor site0

我正在尝试添加

instance YesodAuthEmail App 
Run Code Online (Sandbox Code Playgroud)

Yesod-Postgres脚手架(是 1.6 版)并陷入编译错误。

相关代码是:

instance YesodAuth App where
     type AuthId App = UserId
     ....
     authPlugins :: App -> [AuthPlugin App]
     authPlugins app = [authOpenId Claimed []] ++ extraAuthPlugins
         where extraAuthPlugins = [ authEmail ]

instance YesodAuthEmail App where
    type AuthEmailId App = UserId

    afterPasswordRoute _ = HomeR

    addUnverified email verkey =
        runDB $ insert $ User email Nothing 
Run Code Online (Sandbox Code Playgroud)

我收到的错误是:

/home/justin/code/yesodemail/src/Foundation.hs:273:11: error:
• Could not deduce: m ~ HandlerFor site0 from the context: MonadAuthHandler App …

haskell authorization type-families yesod

3
推荐指数
1
解决办法
213
查看次数