【波浪动态特效】基于jquery实现页面底部波浪动画效果(附完整源码下载)

news/2024/5/2 12:01:01/文章来源:https://blog.csdn.net/hdp134793/article/details/132065905

文章目录

  • 写在前面
  • 涉及知识点
  • 实现效果
  • 1、搭建页面
    • 1.1、创建两个片区
    • 1.2、创建波浪区域
    • 1.3、静态页面源码
  • 2、JS实现波浪效果
    • 2.1 动画原理
    • 2.2 动画源码
  • 3、源码分享
    • 3.1 百度网盘
    • 3.2 123云盘
    • 3.3 邮箱留言
  • 总结


写在前面

想必搭建过企业官网的大多数对这个效果不陌生吧,尤其是现在这么卷的前端行业,很多特效是眼花缭乱,各种组件也是层出不穷,不得不让很多人望而却步,因此我马不停蹄的出了这旷世之作。只望大家能学有所长,接下来请听我娓娓道来。

涉及知识点

Jquery如何实现底部波浪动画,如何实现网站底部动态波浪效果,js实现页面波浪效果,前端页面实现网站底部波浪动态背景,jQuery网站底部动态波浪背景动画特效。
版权声明:此文原创于CSDN博主-《拄杖盲学轻声码》,主页有很多分享的代码,期待您的访问。

实现效果

这个主要为了给大家一个最终实现效果的反馈,文尾附完整代码包的分享链接。
在这里插入图片描述

1、搭建页面

1.1、创建两个片区

创建两个div容器,分别用于存放不同效果的盒子,我采用的是相对布局的方式,主要通过设置样式和html,其中效果如下所示:
在这里插入图片描述

其中html结构如下所示:

<body><div style="margin-top: 100px"></div><!-- 更多请关注CSDN博主-《拄杖盲学轻声码》 --><!-- footer --><div class="wave-box"><!-- 存放波浪 --></div><div class="footer"><!-- 存放底部导航 --></div><!-- footer end --><div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';"><p></p><p></p></div>
</body>

1.2、创建波浪区域

其实在A部分我们就已经创建好了两个div,然后就是针对波浪区域添加波浪效果,当然这里核心还是用背景图片,但是不是想象的那种大图,我用了两张图片,为的是两张图片动态效果,来回滚动形成一种波浪的效果。
首先放一个波浪效果(底部颜色改成灰色方便区分):
在这里插入图片描述

此时创建好了一个波浪,设置背景图即可。
采用相对布局的方式再添加一个效果如下:
在这里插入图片描述

当我们最后底色再设置成和其中一组波浪相同的话就有波浪的效果啦。
在这里插入图片描述

到最后就是丰富元素的过程啦。具体代码我先贴出,当然也可以完整的包在文尾下载。
最终丰富后静态页面效果(不带波浪)如下:
在这里插入图片描述

版权声明:此文原创于CSDN博主-《拄杖盲学轻声码》,主页有很多分享的代码,期待您的访问。

1.3、静态页面源码

Html代码所示

<div style="margin-top: 100px"></div><!-- footer --><div class="wave-box"><div class="marquee-box marquee-up" id="marquee-box"><div class="marquee"><div class="wave-list-box" id="wave-list-box1"><ul><li><img height="60" alt="波浪" src="images/wave_02.png"></li></ul></div><div class="wave-list-box" id="wave-list-box2"><ul><li><img height="60" alt="波浪" src="images/wave_02.png"></li></ul></div></div></div><div class="marquee-box" id="marquee-box3"><div class="marquee"><div class="wave-list-box" id="wave-list-box4"><ul><li><img height="60" alt="波浪" src="images/wave_01.png"></li></ul></div><div class="wave-list-box" id="wave-list-box5"><ul><li><img height="60" alt="波浪" src="images/wave_01.png"></li></ul></div></div></div></div><div class="footer"><div class="auto clearfix"><!-- footer主要--><div class="five-superiority"><ul class="five-superiority-list clearfix"><li class="compensate_ico"><a href="#compensate"><span class="superiority-icon"></span><span>100倍故障赔偿</span></a></li><li class="retreat_ico"><a href="#refund"><span class="superiority-icon"></span><span>5天无理由退款</span></a></li><li class="technology_ico"><a class="superiority-text" href="#afterService"><span class="superiority-icon"></span><span>7x24小时技术支持</span></a></li><li class="prepare_ico"><a href="#ico"><span class="superiority-icon"></span><span>0元快速备案</span></a></li><li class="service_ico"><a href="#secret"><span class="superiority-icon"></span><span>1V1专席秘书</span></a></li></ul></div><div class="footer-floor1"><div class="footer-list"><ul><li class="flist-title">产品与服务</li><li><a href="#"><strong>弹性云服务器</strong></a></li><li><a href="#"><strong>服务器托管</strong></a></li><li><a href="#"><strong>云虚拟主机</strong></a></li><li><a href="#"><strong>某公司管家</strong></a></li><li><a href="#"><strong>某公司监控</strong></a></li></ul><ul><li class="flist-title">云解决方案</li><li><a href="#">金融解决方案</a></li><li><a href="#">电商解决方案</a></li><li><a href="#">移动解决方案</a></li><li><a href="#">游戏解决方案</a></li><li><a href="#">网站解决方案</a></li></ul><ul><li class="flist-title">技术与支持</li><li><a href="#" target="user/">工单系统</a></li><!--<li><a href="http://icp.niaoyun.com/">备案中心</a></li>--><li><a href="#">意见反馈</a></li><li><a href="">会员服务</a></li><li><a href="#">IDC公司</a></li><li><a href="#">帮助中心</a></li></ul><ul class="flist-4"><li class="flist-title">关于某公司</li><li><a href="#">公司简介</a></li><li><a href="#">新闻动态</a></li><li><a href="#">加入我们</a></li><li><a href="#">服务协议</a></li><li><a href="#">友情链接</a></li></ul><div class="clear-float"></div></div><div class="footer-right"><div class="telephone" title="服务热线"><span></span><div class="tel-number">400-688-3065</div></div><div class="official-plat"><p class="weixin" style="background-image: "><span id="wx-corner"></span></p><p class="weibo" style="background-image: "><span id="wb-corner"></span></p><ul><li><a href="#a_null"><span class="weixin-logo"></span>某公司官方微信</a></li><li title="点击打开官方微博"><a href="#" target="_blank"><span class="weibo-logo"></span>某公司官方微博</a></li><li title="点击打开官方客服"><a href="http://www.baofumeng.cn/inithdd/#/rewordData"><spanclass="qq-logo"></span>某公司官方客服</a></li></ul></div></div><div class="clear-float"></div></div></div><div class="footer-floor2"><p>更多内容可关注CSDN博主《拄杖盲学轻声码》.</p><p>来源:<a href="http://www.baofumeng.cn/inithdd/#/rewordData" target="_blank">技术英雄榜</a></p></div></div>

CSS代码所示

/* 更多请关注CSDN博主-《拄杖盲学轻声码》*/
* {margin: 0;padding: 0;box-sizing: border-box;list-style: none
}body {font-family: "Microsoft Yahei";min-width: 1000px
}a {outline: 0;text-decoration: none
}strong {font-weight: 400
}.strong {font-weight: 700
}::selection {background: #1EACDF;color: #fff
}img {border: 0
}::-moz-selection {background: #1EACDF;color: #fff
}::-webkit-selection {background: #1EACDF;color: #fff
}.autoWidth {margin: 0 auto;min-width: 1000px;max-width: 1200px
}.auto {margin: 0 auto;min-width: 1000px;max-width: 1200px
}@media screen and (max-width:1233px) {.auto {padding-left: 10px}
}.clearfix:after,
.clearfix:before {display: table;line-height: 0;content: ""
}.clearfix:after {clear: both
}.clear-float {clear: both
}.footer {width: 100%;background-color: #009fd9;font-family: "Microsoft Yahei"
}.footer-floor1 {width: 100%;padding: 36px 0 60px
}.footer-list {width: 69%;height: 100%;float: left
}.footer-list ul {float: left;margin-right: 13%
}.footer-list .flist-4 {margin-right: 0
}.footer-list li {line-height: 32px
}.footer-list li a {color: #b6e2f2;font-size: 12px;text-decoration: none
}.footer-list li a:hover {text-decoration: underline;color: #fff
}.footer-list .flist-title {font-size: 16px;color: #fff;margin-bottom: 15px
}.footer-floor2 {width: 100%;border-top: 1px solid #4cc3ed;padding: 20px 0;text-align: center
}.footer-floor2 p {text-align: center;color: #b6e2f2;font-size: 12px;line-height: 30px
}.footer-floor2 p span {font-family: PingFangSC-Light, 'helvetica neue', 'hiragino sans gb', tahoma, 'microsoft yahei ui', 'microsoft yahei', simsun, sans-serif
}.footer-floor2 a {color: #b6e2f2
}.footer-floor2 a:hover {color: #a8d0e0;text-decoration: underline
}.foot-link {margin: 0 15px;text-decoration: none;color: #b6e2f2
}.foot-link:hover {text-decoration: underline
}.footer-right {width: 300px;float: right
}.telephone {width: 100%;height: 32px;line-height: 32px;color: #fff
}.telephone span {display: inline-block;width: 32px;height: 32px;float: left;background: url(../images/phone_32px.png);margin-left: 16%
}.telephone .tel-number {font-size: 30px;font-weight: 400;text-align: right
}.official-plat {width: 100%;height: 100%;margin-top: 20px;position: relative
}.official-plat ul {float: right;margin-top: 7px
}.official-plat ul li span {display: inline-block;width: 32px;height: 32px;background: url(../images/plat_icon.png) no-repeat 0 0;line-height: 32px;float: left;margin-right: 12px
}.official-plat ul li .weibo-logo {background: url(../images/plat_icon.png) no-repeat -32px 0
}.official-plat ul li .qq-logo {background: url(../images/plat_icon.png) no-repeat -64px 0
}.official-plat ul li {height: 45px
}.official-plat ul a {display: inline-block;height: 32px;width: 100%;line-height: 32px;color: #fff;text-decoration: none;font-size: 12px
}.official-plat>p {display: inline-block;width: 132px;height: 132px;border: 1px solid #ddd;background-color: #fff
}.official-plat .weixin {position: absolute;top: 0;left: 10px;background-image: url(../images/plat_qrcode.png);background-repeat: no-repeat;background-position: 0 0
}.official-plat .weibo {position: absolute;top: 0;left: 10px;background-image: url(../images/plat_qrcode.png);background-repeat: no-repeat;background-position: -132px 0;display: none
}#wx-corner {border: 10px solid transparent;border-left: 10px solid #fff;position: absolute;top: 12px;right: -20px;z-index: 10
}#wb-corner {border: 10px solid transparent;border-left: 10px solid #fff;position: absolute;top: 58px;right: -20px;z-index: 10
}.five-superiority {width: 100%;border-bottom: 1px solid #27aede;padding: 10px 0 20px
}.five-superiority-list li {float: left;width: 20%;height: 36px;text-align: center;border-left: 1px solid #27aede
}.five-superiority-list li:first-child {border-left: none
}.five-superiority-list li a {display: inline-block;position: relative;width: 100%;height: 36px;line-height: 36px;background: no-repeat 2% center;text-indent: 2em;color: #fff;font-size: 16px
}.five-superiority-list li a:hover {color: #bfe7f5
}.five-superiority-list li a.superiority-text {text-indent: 4em
}.superiority-icon {position: absolute;width: 40px;height: 40px;left: 10%;background-repeat: no-repeat;background-image: url(../images/footer_youshi.png)
}.compensate_ico .superiority-icon {background-position: 0 0
}.compensate_ico:hover .superiority-icon {background-position: 0 -50px
}.retreat_ico .superiority-icon {background-position: 0 -100px
}.retreat_ico:hover .superiority-icon {background-position: 0 -150px
}.technology_ico .superiority-icon {background-position: 0 -200px
}.technology_ico:hover .superiority-icon {background-position: 0 -250px
}.prepare_ico .superiority-icon {background-position: 0 -300px
}.prepare_ico:hover .superiority-icon {background-position: 0 -350px
}.service_ico .superiority-icon {background-position: 0 -400px
}.service_ico:hover .superiority-icon {background-position: 0 -450px
}.marquee-box {overflow: hidden;width: 100%;position: absolute;left: 0;top: 0
}.marquee {width: 8000%;height: 60px
}.wave-list-box {float: left
}.wave-list-box ul {float: left;height: 60px;overflow: hidden;zoom: 1
}.wave-list-box ul li {height: 60px;width: 100%;float: left;line-height: 30px;list-style: none
}.wave-box {width: 100%;position: relative;height: 60px;
}

2、JS实现波浪效果

2.1 动画原理

其实这个地方是我们的核心动画代码,前面页面搭建就是为效果提供基础的保障,这个就是为页面提供灵魂性的东西,核心知识点在于jquery scrollLeft动画,因为scrollLeft主要用于获取或设置元素的水平滚动位置,通过定时器调整他的位置从而实现一种横向滚动的效果,别的也不多说,我直接贴代码吧。

2.2 动画源码

//波浪动画

$(function () {var marqueeScroll = function (id1, id2, id3, timer) {var $parent = $("#" + id1);var $goal = $("#" + id2);var $closegoal = $("#" + id3);$closegoal.html($goal.html());function Marquee() {if (parseInt($parent.scrollLeft()) - $closegoal.width() >= 0) {$parent.scrollLeft(parseInt($parent.scrollLeft()) - $goal.width());}else {$parent.scrollLeft($parent.scrollLeft() + 1);}}setInterval(Marquee, timer);}var marqueeScroll1 = new marqueeScroll("marquee-box", "wave-list-box1", "wave-list-box2", 20);var marqueeScroll2 = new marqueeScroll("marquee-box3", "wave-list-box4", "wave-list-box5", 40);
});

3、源码分享

3.1 百度网盘

链接:https://pan.baidu.com/s/1uqsY7WCa_tleJVR4w88FBg
提取码:hdd6

3.2 123云盘

链接:https://www.123pan.com/s/ZxkUVv-11I4.html
提取码:hdd6

3.3 邮箱留言

评论区留下您的邮箱账号,博主看到第一时间发给您,祝您生活愉快!


总结

以上就是今天要讲的内容,本文主要介绍了如何实现网站底部动态波浪效果,js实现页面波浪效果,前端页面实现网站底部波浪动态背景,jQuery网站底部动态波浪背景动画特效,也期待大家一起进步哈,2023年一起加油!!!

版权声明:此文原创于CSDN博主-《拄杖盲学轻声码》,主页有很多分享的代码,期待您的访问。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_150447.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

vue中显示在页面顶部的进度条插件——NProgress

我们在一些网站中经常见到导航栏上方的进度条显示&#xff0c;大家仔细观察&#xff0c;其实csnd中也有类似的效果&#xff0c;如下图显示效果&#xff0c;我们现在就来一起看看这个功能需求是怎么实现的。 一、功能需求 首先&#xff0c;实现这个功能其实不难&#xff0c;说实…

C# Microsoft消息队列服务器的使用 MSMQ

先安装消息队列服务器 private static readonly string path ".\\Private$\\myQueue";private void Create(){if (!MessageQueue.Exists(path)){MessageQueue.Create(path);}}private void Send(){Stopwatch stopwatch new Stopwatch();stopwatch.Start();Message…

动画制作选择Blender还是Maya

Blender和Maya是两种最广泛使用的 3D 建模和动画应用程序。许多经验丰富的用户表示&#xff0c;Blender 在雕刻工具方面远远领先于 Maya&#xff0c;并且在 3D 建模方面达到了相同的质量水平。对于刚接触动画行业的人来说&#xff0c;您可能会问“我应该使用 Blender 还是 Maya…

复习之vsftp服务

一、vsftp服务简介 文件传输协议&#xff08;File Transfer Protocol&#xff0c;FTP&#xff09;是用于在网络上进行文件传输的一套标准协议&#xff0c;它工作在 OSI 模型的第七层 即应用层&#xff0c; 使用 TCP 传输而不是 UDP&#xff0c; 客户在和服务器建立连接前要经过…

mac电脑访问windows共享文件夹连接不上(设置445端口)

前提&#xff1a;首先需要保证mac和windows都在同一局域网内&#xff0c;如果不在肯定是连不上的&#xff0c;就不用往下看了。 事情是这样的&#xff0c;公司入职发了mac电脑&#xff0c;但是我是window重度用户&#xff0c;在折腾mac的过程中&#xff0c;有许多文件需要从wi…

运维作业4

一.简述静态网页和动态网页的区别。 静态页面资源特征 1. 处理文件类型&#xff1a;如.html、jpg、.gif、.mp4、.swf、.avi、.wmv、.flv等 2. 地址中不含有问号"&#xff1f;"或&等特殊符号。 3. 保存在网站服务器文件系统上的&#xff0c;是实实在在保存在服务器…

【有趣的】关于Map的一些小测试

Map在代码中用到得非常多&#xff0c;它是无序的、key-value结构的&#xff0c;其读取会非常快。 今天看了个小文章Map判空 、空字符串、空key值等各种判断方法&#xff0c;你都掌握了吗&#xff1f;便自己也玩一下。 一、判空 因为对象已经new出来了&#xff0c;所以map指向的…

Zabbix报警机制、配置钉钉机器人、自动发现、主动监控概述、配置主动监控、zabbix拓扑图、nginx监控实例

day02 day02配置告警用户数超过50&#xff0c;发送告警邮件实施验证告警配置配置钉钉机器人告警创建钉钉机器人编写脚本并测试添加报警媒介类型为用户添加报警媒介创建触发器创建动作验证自动发现配置自动发现主动监控配置web2使用主动监控修改配置文件&#xff0c;只使用主动…

汽车智能化再掀新热潮!「中央计算架构」进入规模量产周期

中央计算区域控制的新一代整车电子架构&#xff0c;已经成为车企继电动化、智能化&#xff08;功能上车&#xff09;之后&#xff0c;新一轮竞争的焦点。 如果说智能化的1.0阶段&#xff0c;是智能驾驶智能座舱的争夺战&#xff1b;那么&#xff0c;即将进入的2.0阶段&#xff…

爱尔眼科四川省区“同心博爱 光明工程”“西部健康公益行”炉霍站启动

8月1日&#xff0c;“同心博爱 光明工程”“西部健康公益行”炉霍站出征仪式在四川爱尔眼科医院隆重举行。 此次公益活动由民革成都市委会、中共锦江区委统战部指导&#xff0c;如意树爱心促进会主办&#xff0c;民革锦江区总支部、爱尔眼科四川省区支持&#xff0c;四川爱尔眼…

SCI论文的发文的模板(Elsevier,MDPI,IEEE)

不同的SCI期刊都有自己的出版商&#xff0c;不同的出版商有不同的发文格式。 最简单的方式就是去查官网上面&#xff0c;常用的期刊格式如下。到对应的位置下载模板即可&#xff0c;推荐使用latex。 MDPI MDPI | Preparing Manuscripts in LaTeX Elsevier Guide for authors …

【Linux指令篇】--- Linux常用指令汇总(克服指令繁杂问题)

文章目录 前言&#x1f31f;一、Linux基本指令&#x1f31f;二、ls指令&#x1f30f;2.1.语法&#xff1a;&#x1f30f;2.2.功能&#xff1a;&#x1f30f;2.3.常用选项&#xff1a; &#x1f31f;三、pwd指令&#x1f30f;3.1.语法&#xff1a;&#x1f30f;3.2.功能&#xf…

C++11 通用工具

通用工具 目录 pair和tuple智能指针数值极值type trait 和type utility辅助函数clock和timerbitset随机数 1 pair和Tuple 1.1 pair 头文件 #include<utility>pair定义 pair<string,string> author{James","joyce"};)] --> pair操作 1.2 tup…

100 个鲜为人知的 Python 高级技巧 0-20

100 鲜为人知的 Python 功能 这篇文章是为那些每天使用 Python&#xff0c;但从未真正坐下来通读所有文档的人准备的。 如果您已经使用 Python 多年&#xff0c;并且知道足够多的知识来完成工作&#xff0c;那么为了发现一些新技巧而通读几千页的文档可能不是明智之举。 因此&a…

【业务功能篇61】SpringBoot项目流水线 dependencyManagement 标签整改依赖包版本漏洞问题

业务场景&#xff1a;当前我们项目引入了公司自研的一些公共框架组件&#xff0c;比如SSO单点登录jar包&#xff0c;文件上传服务jar包等公共组件&#xff0c;开发新功能&#xff0c;本地验证好之后&#xff0c;部署流水线&#xff0c;报出一些jar包版本的整改漏洞问题&#xf…

变透明的黑匣子:UCLA 开发可解释神经网络 SNN 预测山体滑坡

内容一览&#xff1a;由于涉及到多种时空变化因素&#xff0c;山体滑坡预测一直以来都非常困难。深度神经网络 (DNN) 可以提高预测准确性&#xff0c;但其本身并不具备可解释性。本文中&#xff0c;UCLA 研究人员引入了 SNN。SNN 具有完全可解释性、高准确性、高泛化能力和低模…

Spring系列二:基于注解配置bean【建议收藏】

文章目录 &#x1f497;通过注解配置bean&#x1f35d;基本介绍&#x1f35d;快速入门&#x1f35d;注意事项和细节 &#x1f497;自己实现Spring注解配置Bean机制&#x1f35d;需求说明&#x1f35d;思路分析&#x1f35d;注意事项和细节 &#x1f497;自动装配 Autowired&…

P3373 【模板】线段树 2(乘法与加法)(内附封面)

【模板】线段树 2 题目描述 如题&#xff0c;已知一个数列&#xff0c;你需要进行下面三种操作&#xff1a; 将某区间每一个数乘上 x x x&#xff1b;将某区间每一个数加上 x x x&#xff1b;求出某区间每一个数的和。 输入格式 第一行包含三个整数 n , q , m n,q,m n,…

Flexbox

Flexbox 一、什么是 Flexbox ?二、Flexbox 知识点2.1、Flex Container&#xff08;容器&#xff09;2.1.1、轴2.1.2、添加flex支持2.1.3、flex-direction&#xff08;主轴向&#xff09;2.1.3.1、row 横向2.1.3.2、row-reverse 横向翻转2.1.3.3、column 纵向2.1.3.4、column-r…

宇凡微2.4g遥控船开发方案,采用合封芯片

2.4GHz遥控船的开发方案是一个有趣且具有挑战性的项目。这样的遥控船可以通过无线2.4GHz频率进行远程控制&#xff0c;让用户在池塘或湖泊上畅游。以下是一个简要的2.4GHz遥控船开发方案&#xff1a; 基本构想如下 mcu驱动两个小电机&#xff0c;小电机上安装两个螺旋桨&#…