Javascript 连续html页面滚动

Javascript 连续html页面滚动,javascript,jquery,Javascript,Jquery,我想实现一个连续滚动的html页面 我发现了一个div示例的连续滚动,但我无法修改代码,使其在整个html页面上工作: 以下是我的代码: 非常感谢您为我指出正确的方向。如果您将div的宽度/高度设置为空间的100%,会怎么样 更新: 天真的答案是,页面的任何内容都存在于滚动分区中。您需要调整CSS中的宽度 #verticalScroller { position: absolute; width:100%; //set the wid

我想实现一个连续滚动的html页面

我发现了一个div示例的连续滚动,但我无法修改代码,使其在整个html页面上工作:

以下是我的代码:


非常感谢您为我指出正确的方向。

如果您将div的宽度/高度设置为空间的100%,会怎么样

更新:


天真的答案是,页面的任何内容都存在于滚动分区中。

您需要调整CSS中的宽度

#verticalScroller {
    position: absolute;
    width:100%;                       //set the width to 100% to take over the space
    height: 180px;
    border: 1px solid red;
    overflow: hidden;
}

#verticalScroller > div{
    position:absolute;
    width:100%;                     //set the width to 100% there also 
    height:50px;
    border: 1px solid blue;
    overflow:hidden;
}

您是否看过

将此代码放置在此处将帮助您获得更好的响应。您正在寻找的是一个paralax滚动网站。试试谷歌搜索
#verticalScroller {
    position: absolute;
    width:100%;                       //set the width to 100% to take over the space
    height: 180px;
    border: 1px solid red;
    overflow: hidden;
}

#verticalScroller > div{
    position:absolute;
    width:100%;                     //set the width to 100% there also 
    height:50px;
    border: 1px solid blue;
    overflow:hidden;
}