经过大量的研究,当模态窗口打开时,我无法找到适当的解决方案,可以转移到固定定位元素,封面图像和标准内容的右侧.
注意:我正在寻找一个通用,干净的解决方案,而不是一个只能在特定布局上工作的硬编码修复.
有谁知道如何解决这个问题?请参考此示例:http://codepen.io/microcipcip/pen/kXdRWK
body {
height: 2500px;
&.-modal-open {
overflow: hidden;
}
}
.fixed {
position: fixed;
top: 0;
left: 0;
width: 100%;
padding: 20px 0;
background: #FF0000;
}
.modal {
overflow-x: hidden;
overflow-y: scroll;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
opacity: 0;
transition: opacity .2s ease-in-out;
body.-modal-open & {
opacity: 1;
}
}
Run Code Online (Sandbox Code Playgroud) 我不明白对象的 Writable 和 Configurable 属性。比如在Object.prototype的MDN中,有一张表,可以清楚的看到Object.prototype的Configurable, Writable and Enumerable Property Attributes被锁定了。
但是,我可以编写和扩展 Object.prototype,例如使用以下代码:
// Example 1
Object.prototype.testing=999;
console.log(Object.testing); // 999
// Example 2
var o = {};
console.log(o.testing); // 999
Run Code Online (Sandbox Code Playgroud) 我试图弄清楚如何使用 SASS 在每个循环上声明和访问嵌套列表。我想在第一个循环中使用第二级循环?
这是我的示例代码:
$chap1-blocks: (5
(1, -70, 30),
(2, -130, 80),
(3, 10, -30),
(4, -90, 50)
),
(7
(1, -70, 30),
(2, -130, 80),
(3, 10, -30),
(4, -90, 50)
),
(10
(1, -70, 30),
(2, -130, 80),
(3, 10, -30),
(4, -90, 50)
);
@each $chap1-block in $chap1-blocks {
$section: nth($chap1-block, 1); //5
$row: nth($chap1-block, ??); //1
$top: nth($chap1-block, ??); //-70
$bottom: nth($chap1-block, ??); //30
.section-#{$section} {
.row-#{$row} {
margin: #{$top}px 0 #{$bottom}px;
}
}
}
Run Code Online (Sandbox Code Playgroud)
第一组的期望输出: …