- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
尝试使用 salvattore.(min).js 来实现列,但 javascript 不起作用,除非我在 元素中内联 salvattore.js 代码。
这是我的 test.html 代码
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type='text/css'>
#grid[data-columns]::before {
content: '3 .column.size-1of3';
}
/* These are the classes that are going to be applied: */
.column { float: left; }
.size-1of1 { width: 100%; }
.size-1of2 { width: 50%; }
.size-1of3 { width: 33.333%; }
@media screen and (max-width: 480px){
#grid[data-columns]::before {
content: '1 .column.size-1of1';
}
}
@media screen and (min-width: 481px) and (max-width: 768px) {
#grid[data-columns]::before {
content: '2 .column.size-1of2';
}
}
@media screen and (min-width: 769px) {
#grid[data-columns]::before {
content: '2 .column.size-1of2';
}
}
/* Again, youre free to use and define the classes: */
.column { float: left; }
.size-1of1 { width: 100%; }
.size-1of2 { width: 50%; }
.size-1of3 { width: 33.333%; }
</style>
<script src='/salvattore.min.js' type='text/javascript'></script>
</head>
<body>
<div id="grid" data-columns>
<div>Item #1</div>
<div>Item #2</div>
<div>Item #3</div>
<div>Item #4</div>
<div>Item #5</div>
<div>Item #6</div>
<div>Item #7</div>
<div>Item #8</div>
<div>Item #9</div>
<div>Item #10</div>
<div>Item #11</div>
<div>Item #12</div>
<div>Item #13</div>
<div>Item #14</div>
</div>
</body>
</html>
salvattore.(min).js 正在加载和运行,因为它在窗口被挤压时更改了::before 伪元素,但 Item div 显示为 block ,因此呈现为垂直列表(无论我如何调整窗口大小)。
我注意到如果我将 <script> 标记替换为
<script type="text/javascript">
... cut and paste salvatorre.js (not the min.js) here ...
</script>
它有效,但这显然是一种错误的形式。我正在 Chrome 和 IE 中进行测试,但都不起作用。有什么建议吗?
最佳答案
如果您仍在寻找答案...我发现我需要在关闭 body 标签之前包含 salvattore.min.js :) 而不是在标题中。
<script src="js/salvattore.min.js"></script>
</body>
</html>
关于javascript - Salvattore 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27120109/
尝试使用 salvattore.(min).js 来实现列,但 javascript 不起作用,除非我在 元素中内联 salvattore.js 代码。 这是我的 test.html 代码
我正在尝试获取salvattore参与我的 embercli 项目。目前我已经按照 salvattore.com 中的示例进行操作它有点工作,但将 '3 .column.size-1of3' 放在网格
我正在尝试使用 getJSON 将数组值输出到 src 属性中,使用这些值插入 Salvattore插入。我可以通过 console.log 获取值,但是当我尝试将值输入到我的 function ap
我尝试整合 Salvattore (CSS 中的砌体替代方案)在我的 Aurelia 中应用程序,但不幸的是它不起作用。在尝试了很多事情之后,我感到很失望,我想也许根本不可能让 Salvattore
我是一名优秀的程序员,十分优秀!