我正在尝试实现此Stack Overflow问题中概述的内容,没有jQuery依赖:stackoverflow.com/questions/18358816/sticky-sidebar-stick-to-bottom-when-scrolling-down-top-when-scrolling-up
但我不想劫持这个问题.
基本上,我希望侧边栏中的内容可以独立滚动,但在视口到达滚动条上的侧边栏内容的任一端时固定.
elementTop当侧边栏绝对定位时,我的主要障碍似乎无法计算变量,而且我已设置为全高度的容器的顶部和底部之间.
完整代码如下:
var StickySidebar = function(eventie) {
var container, containerTop, containerHeight, // container
element, elementTop, elementHeight, elStyle, // element
viewportTop = -1, viewportHeight, documentTop, // viewport
lastViewportTop, scrollingDown, top = false , bottom = false,// sticky vars
scroll = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.msRequestAnimationFrame ||
window.oRequestAnimationFrame ||
function(callback){ window.setTimeout(callback, 1000/60); },
options = {
container : document.querySelector('.sidebar-container'),
element : document.querySelector('.sidebar'),
sidebarClass : 'sidebar',
bottomOffset : -15,
topOffset: 90,
},
_updateValue = function() …Run Code Online (Sandbox Code Playgroud) 我知道这应该是一个简单的任务,但我在选择一个标题元素的最后一个单词并将其包装在一个跨度中时遇到问题,所以我可以添加样式更改.
这是我到目前为止所拥有的
$('.side-c h3').split(/\s+/).pop().wrap('<span />');
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激
我正在尝试使用以下存储桶策略公开存储在s3存储桶中的所有图像。
{
"Id": "Policy1380877762691",
"Statement": [
{
"Sid": "Stmt1380877761162",
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::<bucket-name>/*",
"Principal": {
"AWS": [
"*"
]
}
}
]
Run Code Online (Sandbox Code Playgroud)
}
我还有其他4个具有相同存储桶策略的类似s3存储桶,但我不断收到403错误。
当我尝试将存储桶中的内容迁移到新帐户时,已使用s3cmd sync传输了该存储桶中的图像。
我唯一看到的区别是