本文主要是介绍parallax插件 视差效果实现,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
效果图:
首先引入需要的文件,parallax依赖于jQuery,parallax下载地址https://cdn.bootcss.com/parallax/2.1.3/jquery.parallax.js,
使用时可以参考此处的文档https://blog.csdn.net/qq_26383604/article/details/72637068
<script src="js/jquery.3.3.1.js" type="text/javascript"></script>
<script src="js/jquery.parallax.js" type="text/javascript"></script>
css部分:
<style type="text/css">
*{
margin: 0px;
padding: 0px;
}
.layer{
/*position: absolute; */
}
.layer2{
这篇关于parallax插件 视差效果实现的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!