使用背景图片创建 Javascript 个图库
Create a Javascript Gallery with Background Images
需要帮助创建整页画廊。我尝试了各种选择。我正在尝试创建整页画廊,让用户一次垂直滚动 1 张图像。
这是我的代码:
<style>
#img1 {
background-image: url("<?php echo $image ;?>");
height:100vh !Important;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
#img2 {
background-image: url("<?php echo $image2 ;?>");
height:100vh !Important;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
#img3 {
background-image: url("<?php echo $image3 ;?>");
height:100vh !Important;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
</style>
<div id="img1"></div>
<div id="img2"></div>
<div id="img2"></div>
我卡在 javascript/jquery 检测用户是否滚动的解决方案上。如果用户向上滚动 10 个像素或向下滚动 10 个像素,我想更改图像。
这是我正在尝试实现的示例:
http://themes.themegoods.com/photome/demo/gallery-archive/gallery-archive-fullscreen/
最好使用像 "fullPage.js, smart scroll, pagePiling.js" 这样的 js 库,它们可以帮助您制作完美的页面或画廊滚动,就像您想要实现的那样,有关更多信息,请访问以下链接:
需要帮助创建整页画廊。我尝试了各种选择。我正在尝试创建整页画廊,让用户一次垂直滚动 1 张图像。
这是我的代码:
<style>
#img1 {
background-image: url("<?php echo $image ;?>");
height:100vh !Important;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
#img2 {
background-image: url("<?php echo $image2 ;?>");
height:100vh !Important;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
#img3 {
background-image: url("<?php echo $image3 ;?>");
height:100vh !Important;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
</style>
<div id="img1"></div>
<div id="img2"></div>
<div id="img2"></div>
我卡在 javascript/jquery 检测用户是否滚动的解决方案上。如果用户向上滚动 10 个像素或向下滚动 10 个像素,我想更改图像。
这是我正在尝试实现的示例: http://themes.themegoods.com/photome/demo/gallery-archive/gallery-archive-fullscreen/
最好使用像 "fullPage.js, smart scroll, pagePiling.js" 这样的 js 库,它们可以帮助您制作完美的页面或画廊滚动,就像您想要实现的那样,有关更多信息,请访问以下链接: