小编Eli*_*oux的帖子

固定位置水平滚动条

我有一个很长的div(比屏幕更长),它的水平滚动条出现在div的底部,我希望水平滚动条出现在窗口的底部而不是div的底部。我的情况与此小提琴类似,并且我无法真正修改布局...

例:

  <p>blabla</p>
  <div id="scrolling">
    <div id="longdiv">
      <p>Looooooong looooong div, please scroll down to see the horizontal scrollbar at the bottom! If only it was <pre>position:fixed; bottom:0px;</pre>!</p>
    </div>
  </div>
  <p>blabla</p>
Run Code Online (Sandbox Code Playgroud)

与相应的CSS:

#scrolling {
  overflow: auto;
  width: 500px;
  display: block;
  position: relative;
  border: 1px solid blue;
}
#longdiv {
  width: 1500px;
  height: 2000px;
  border: 1px solid red;
}
Run Code Online (Sandbox Code Playgroud)

我怎样才能实现自己想要的?

谢谢!

注意:某种程度上与将滚动条固定到底部相同,但更完整,并带有示例,并且与将div的水平滚动条固定到页面底部不同,因为我无法根据已接受的(唯一的)答案修改布局。

编辑:尽管我在Google上找不到与此问题有关的任何东西,但看来我不是第一个遇到此问题的人:gmail实现了这样的事情。如果您使用一个很小的窗口打开一个邮件线程,则该线程的div有一个自定义滚动条,它总是出现在屏幕底部...太糟糕的源代码被混淆了...

html javascript css jquery

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

angularjs中的模板递归限制(摘要循环)

我使用递归模板在angularJS中渲染树,但当树深度超过10时,AngularJS在控制台上给出了一个错误:

"Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Run Code Online (Sandbox Code Playgroud)

实施例在此plnkr.

如果我理解正确并试着在上面加上简单的话(我知道它更复杂):

  • 在第一个$ digest()迭代中,它包含第一个模板,因此创建了一个ŵatcher item(实际上是item.ID和item.children
  • 然后,不是递归地包含模板并在之后创建观察者,它首先要检查item.children,然后重新运行摘要循环 --ttl
  • 然后两个值都是相同的,所以它继续并包括下一个模板并在新的上设置一个观察者item,并返回到第二步

因此,在10次迭代之后,ttl将为0,因此错误,尽管没有实际错误......

那么,有几个问题:

  • 我的分析是否正确?
  • 我应该在角度跟踪器上报告这个(因为我认为报告错误时角度是错误的)?
  • 有一个简单的解决方法吗?

非常感谢你!

编辑:

这个plnkr(由于raw.github你需要用firefox看到)表明bindonce不是这个的解决方案......

recursion angularjs angularjs-scope

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

猫头鹰物化与rdf物化

在具体化方面,最明显的解决方案是RDF具体化,但似乎OWL2有自己的词汇,我想了解原因.让我们举一个例子:如果我有以下数据集(它是我们正在使用的数据集的一小部分,它使用OWL):

@prefix :      <http://purl.bdrc.io/ontology/core/> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .

bdr:T123  a     :Topic ;
    rdfs:seeAlso    bdr:T1129 .
Run Code Online (Sandbox Code Playgroud)

我可以像这样使用RDF来修改和注释seeAlso语句:

_:b0 a             rdf:Statement ;
     rdf:subject   bdr:T123 ;
     rdf:predicate rdfs:seeAlso ;
     rdf:object    bdr:T1129 ;
     rdfs:label    "reification 1" .
Run Code Online (Sandbox Code Playgroud)

但是很容易找到一些例子(这里,这里等):

_:b1 a             owl:Axiom ;
     owl:subject   bdr:T123 ;
     owl:predicate rdfs:seeAlso ;
     owl:object    bdr:T1129 ;
     rdfs:label    "reification 2" .
Run Code Online (Sandbox Code Playgroud)

第一个问题:我的理解是owl:subject,谓词,对象被弃用了,是这样吗?

另一种用OWL来修改和注释三元组的方法似乎是:

_:b2 a                     owl:Axiom ;
     owl:annotatedSource   bdr:T123 ;
     owl:annotatedProperty rdfs:seeAlso ;
     owl:annotatedTarget   bdr:T1129 ;
     rdfs:label …
Run Code Online (Sandbox Code Playgroud)

rdf owl

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

C++段错误在gcc + mingw下但不是gcc + linux

我在Mingw的一个大型程序中有一个sefault,但不是在Linux下.我设法将其减少为以下代码:

#include <iostream>
#include <string>
#include <map>

using namespace std;

const std::string& getConfiguration(const std::string& key, std::map<std::string, std::string> configuration)
{
    map<string, string>::const_iterator it = configuration.find(key);
    return it->second;
}

int main() {
    map<string, string> testmap;
    testmap["key"] = "value";
    map<string, string>::const_iterator it;
    it = testmap.find("key");
    const string& value = it->second;
    cout << value << endl;
    cout << "ok!" << endl;
    const string& valuebis = getConfiguration("key", testmap);
    cout << valuebis << endl;
    cout << "Mingw segfaults before here" << endl;
    return 0; …
Run Code Online (Sandbox Code Playgroud)

c++ gcc mingw

2
推荐指数
2
解决办法
544
查看次数

标签 统计

angularjs ×1

angularjs-scope ×1

c++ ×1

css ×1

gcc ×1

html ×1

javascript ×1

jquery ×1

mingw ×1

owl ×1

rdf ×1

recursion ×1