当前位置: 首页 > news >正文

5.2 JavaScript 案例 - 轮播图

JavaScript - 轮播图

文章目录

  • JavaScript - 轮播图
  • 基础模版
  • 一、刷新页面随机轮播图案例
  • 二、轮播图 定时器版
  • 三、轮播图完整版

基础模版

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>轮播图点击切换</title><style>* {box-sizing: border-box;}.slider {width: 560px;height: 400px;overflow: hidden;}.slider-wrapper {width: 100%;height: 320px;}.slider-wrapper img {width: 100%;height: 100%;display: block;}.slider-footer {height: 80px;background-color: rgb(100, 67, 68);padding: 12px 12px 0 12px;position: relative;}.slider-footer .toggle {position: absolute;right: 0;top: 12px;display: flex;}.slider-footer .toggle button {margin-right: 12px;width: 28px;height: 28px;appearance: none;border: none;background: rgba(255, 255, 255, 0.1);color: #fff;border-radius: 4px;cursor: pointer;}.slider-footer .toggle button:hover {background: rgba(255, 255, 255, 0.2);}.slider-footer p {margin: 0;color: #fff;font-size: 18px;margin-bottom: 10px;}.slider-indicator {margin: 0;padding: 0;list-style: none;display: flex;align-items: center;}.slider-indicator li {width: 8px;height: 8px;margin: 4px;border-radius: 50%;background: #fff;opacity: 0.4;cursor: pointer;}.slider-indicator li.active {width: 12px;height: 12px;opacity: 1;}</style>
</head><body>
<div class="slider"><div class="slider-wrapper"><img src="./images/slider01.jpg" alt="" /></div><div class="slider-footer"><p>对人类来说会不会太超前了?</p><ul class="slider-indicator"><li class="active"></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><div class="toggle"><button class="prev">&lt;</button><button class="next">&gt;</button></div></div>
</div>
<script>// 1. 初始数据const sliderData = [{ url: './images/slider01.jpg', title: '对人类来说会不会太超前了?', color: 'rgb(100, 67, 68)' },{ url: './images/slider02.jpg', title: '开启剑与雪的黑暗传说!', color: 'rgb(43, 35, 26)' },{ url: './images/slider03.jpg', title: '真正的jo厨出现了!', color: 'rgb(36, 31, 33)' },{ url: './images/slider04.jpg', title: '李玉刚:让世界通过B站看到东方大国文化', color: 'rgb(139, 98, 66)' },{ url: './images/slider05.jpg', title: '快来分享你的寒假日常吧~', color: 'rgb(67, 90, 92)' },{ url: './images/slider06.jpg', title: '哔哩哔哩小年YEAH', color: 'rgb(166, 131, 143)' },{ url: './images/slider07.jpg', title: '一站式解决你的电脑配置问题!!!', color: 'rgb(53, 29, 25)' },{ url: './images/slider08.jpg', title: '谁不想和小猫咪贴贴呢!', color: 'rgb(99, 72, 114)' },]</script>
</body></html>

一、刷新页面随机轮播图案例

需求:当我们刷新页面,页面中的轮播图会显示不同的照片以及样式

模块

  1. 刷新后图片会随机变换
  2. 当图片变化后,底部盒子背景颜色和文字内容会变换
  3. 当图片变化后,小圆点随机一个高亮显示

页面分析

首先使用一个盒子存放图片

image-20240701104344807

其次再使用一个底部模版存放按钮及图片的标题

image-20240701104432655

这里的ul-li,就是里面的底部模块的小点

image-20240701104616952

逻辑分析

  1. 准备一个数组对象,里面包含详细信息

  2. 随机选择一个数字,选出数组对应的对象,更换图片,底部盒子背景颜色及文字内容

  3. 利用随机数字,让小圆点添加高亮的类(addClass),这里利用CSS结构伪类选择器

代码如下所示

目前还不是一个很完整的轮播图,不能点击小圆点、不能前后左右翻页,后面会慢慢的完善

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>轮播图点击切换</title><style>* {box-sizing: border-box;}.slider {width: 560px;height: 400px;overflow: hidden;}.slider-wrapper {width: 100%;height: 320px;}.slider-wrapper img {width: 100%;height: 100%;display: block;}.slider-footer {height: 80px;background-color: rgb(100, 67, 68);padding: 12px 12px 0 12px;position: relative;}.slider-footer .toggle {position: absolute;right: 0;top: 12px;display: flex;}.slider-footer .toggle button {margin-right: 12px;width: 28px;height: 28px;appearance: none;border: none;background: rgba(255, 255, 255, 0.1);color: #fff;border-radius: 4px;cursor: pointer;}.slider-footer .toggle button:hover {background: rgba(255, 255, 255, 0.2);}.slider-footer p {margin: 0;color: #fff;font-size: 18px;margin-bottom: 10px;}.slider-indicator {margin: 0;padding: 0;list-style: none;display: flex;align-items: center;}.slider-indicator li {width: 8px;height: 8px;margin: 4px;border-radius: 50%;background: #fff;opacity: 0.4;cursor: pointer;}.slider-indicator li.active {width: 12px;height: 12px;opacity: 1;}</style>
</head><body>
<div class="slider"><div class="slider-wrapper"><img src="./images/slider01.jpg" alt=""/></div><div class="slider-footer"><p>对人类来说会不会太超前了?</p><ul class="slider-indicator"><!--active是高亮的样式--><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><div class="toggle"><button class="prev">&lt;</button><button class="next">&gt;</button></div></div>
</div>
<script>//1.初始数据const sliderData = [{ url: './images/slider01.jpg', title: '对人类来说会不会太超前了?', color: 'rgb(100, 67, 68)' },{ url: './images/slider02.jpg', title: '开启剑与雪的黑暗传说!', color: 'rgb(43, 35, 26)' },{ url: './images/slider03.jpg', title: '真正的jo厨出现了!', color: 'rgb(36, 31, 33)' },{ url: './images/slider04.jpg', title: '李玉刚:让世界通过B站看到东方大国文化', color: 'rgb(139, 98, 66)' },{ url: './images/slider05.jpg', title: '快来分享你的寒假日常吧~', color: 'rgb(67, 90, 92)' },{ url: './images/slider06.jpg', title: '哔哩哔哩小年YEAH', color: 'rgb(166, 131, 143)' },{ url: './images/slider07.jpg', title: '一站式解决你的电脑配置问题!!!', color: 'rgb(53, 29, 25)' },{ url: './images/slider08.jpg', title: '谁不想和小猫咪贴贴呢!', color: 'rgb(99, 72, 114)' }]//2.创建随机数// function getRandom(N, M) {//   return Math.floor(Math.random() * (M - N + 1)) + N// }//const random = getRandom(1,8)const random = parseInt(Math.random() * sliderData.length) //或者是这么生成随机数也行//3.把对应的数据渲染到标签里面// 3.1获取图片const img = document.querySelector('.slider-wrapper img')//表示slider-wrapper类中的第一个img标签// 3.2修改图片的路径img.src = sliderData[random].url// 3.3获取标签pconst p = document.querySelector('.slider-footer p')//表示slider-footer类中的第一个p标签p.innerHTML = sliderData[random].title// 3.4修改slider-footer中背景板的颜色const sliderFooterDocument = document.querySelector('.slider-footer')sliderFooterDocument.style.backgroundColor = sliderData[random].color//4.底部ul-li进行切换,对应的li进行高亮//这个地方没有用all,因为用all筛选的是一个伪数组const li = document.querySelector(`.slider-indicator li:nth-child(${random + 1})`)//选中第random+1个li(因为random是0-7 而li是1-8)//当前选中的li添加active这个类li.classList.add('active')
</script>
</body></html>

二、轮播图 定时器版

承接上面的代码

需求:每隔一秒钟切换一个图片

分析

  1. 准备一个数组对象,里面包含详情信息(素材包含)

  2. 获取元素

  3. 设置定时器函数

    设置变量++

    找到变量对应的对象

    更改图片、文字信息

    激活小圆点,移除上一个高亮的类名,当前变量对应的小圆点添加类

  4. 处理图片自动复原从头播放(放到变量++后面,紧挨)

    如果图片播放到最后一张,就是大于等于数组的长度

    则把变量重置为0

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>轮播图点击切换</title><style>* {box-sizing: border-box;}.slider {width: 560px;height: 400px;overflow: hidden;}.slider-wrapper {width: 100%;height: 320px;}.slider-wrapper img {width: 100%;height: 100%;display: block;}.slider-footer {height: 80px;background-color: rgb(100, 67, 68);padding: 12px 12px 0 12px;position: relative;}.slider-footer .toggle {position: absolute;right: 0;top: 12px;display: flex;}.slider-footer .toggle button {margin-right: 12px;width: 28px;height: 28px;appearance: none;border: none;background: rgba(255, 255, 255, 0.1);color: #fff;border-radius: 4px;cursor: pointer;}.slider-footer .toggle button:hover {background: rgba(255, 255, 255, 0.2);}.slider-footer p {margin: 0;color: #fff;font-size: 18px;margin-bottom: 10px;}.slider-indicator {margin: 0;padding: 0;list-style: none;display: flex;align-items: center;}.slider-indicator li {width: 8px;height: 8px;margin: 4px;border-radius: 50%;background: #fff;opacity: 0.4;cursor: pointer;}.slider-indicator li.active {width: 12px;height: 12px;opacity: 1;}</style>
</head><body>
<div class="slider"><div class="slider-wrapper"><img src="./images/slider01.jpg" alt=""/></div><div class="slider-footer"><p>对人类来说会不会太超前了?</p><ul class="slider-indicator"><li class="active"></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><div class="toggle"><button class="prev">&lt;</button><button class="next">&gt;</button></div></div>
</div>
<script>// 1. 初始数据const sliderData = [{ url: './images/slider01.jpg', title: '对人类来说会不会太超前了?', color: 'rgb(100, 67, 68)' },{ url: './images/slider02.jpg', title: '开启剑与雪的黑暗传说!', color: 'rgb(43, 35, 26)' },{ url: './images/slider03.jpg', title: '真正的jo厨出现了!', color: 'rgb(36, 31, 33)' },{ url: './images/slider04.jpg', title: '李玉刚:让世界通过B站看到东方大国文化', color: 'rgb(139, 98, 66)' },{ url: './images/slider05.jpg', title: '快来分享你的寒假日常吧~', color: 'rgb(67, 90, 92)' },{ url: './images/slider06.jpg', title: '哔哩哔哩小年YEAH', color: 'rgb(166, 131, 143)' },{ url: './images/slider07.jpg', title: '一站式解决你的电脑配置问题!!!', color: 'rgb(53, 29, 25)' },{ url: './images/slider08.jpg', title: '谁不想和小猫咪贴贴呢!', color: 'rgb(99, 72, 114)' }]//2.获取元素const img = document.querySelector('.slider-wrapper img') //图片元素const p = document.querySelector('.slider-footer p') //p标签let i = 0//3.开启定时器//轮播图的第一张可以不用参与变化,1s后直接播放第二章即可setInterval(function() {i++if (i >= sliderData.length) {// 超过数组长度的话,初始化i = 0}// const obj = sliderData[i]//更换图片路径img.src = sliderData[i].url//字p.innerHTML = sliderData[i].title//小圆点 小圆点从1开始数的//删除之前的activedocument.querySelector('.slider-indicator .active').classList.remove('active')document.querySelector(`.slider-indicator li:nth-child(${i + 1})`).classList.add('active')//小圆点高亮显示}, 1000)</script>
</body></html>

三、轮播图完整版

需求:当点击左右按钮的时候,可以切换轮播图

分析

  • 右侧按钮点击,变量++,如果大于等于8,则复原0
  • 左侧按钮点击,变量–,如果小于0,则复原最后一张
  • 鼠标经过暂停定时器
  • 鼠标离开开启定时器
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>轮播图点击切换</title><style>* {box-sizing: border-box;}.slider {width: 560px;height: 400px;overflow: hidden;}.slider-wrapper {width: 100%;height: 320px;}.slider-wrapper img {width: 100%;height: 100%;display: block;}.slider-footer {height: 80px;background-color: rgb(100, 67, 68);padding: 12px 12px 0 12px;position: relative;}.slider-footer .toggle {position: absolute;right: 0;top: 12px;display: flex;}.slider-footer .toggle button {margin-right: 12px;width: 28px;height: 28px;appearance: none;border: none;background: rgba(255, 255, 255, 0.1);color: #fff;border-radius: 4px;cursor: pointer;}.slider-footer .toggle button:hover {background: rgba(255, 255, 255, 0.2);}.slider-footer p {margin: 0;color: #fff;font-size: 18px;margin-bottom: 10px;}.slider-indicator {margin: 0;padding: 0;list-style: none;display: flex;align-items: center;}.slider-indicator li {width: 8px;height: 8px;margin: 4px;border-radius: 50%;background: #fff;opacity: 0.4;cursor: pointer;}.slider-indicator li.active {width: 12px;height: 12px;opacity: 1;}</style>
</head><body>
<div class="slider"><div class="slider-wrapper"><img src="./images/slider01.jpg" alt=""/></div><div class="slider-footer"><p>对人类来说会不会太超前了?</p><ul class="slider-indicator"><li class="active"></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><div class="toggle"><button class="prev">&lt;</button><button class="next">&gt;</button></div></div>
</div>
<script>// 1. 初始数据const data = [{ url: './images/slider01.jpg', title: '对人类来说会不会太超前了?', color: 'rgb(100, 67, 68)' },{ url: './images/slider02.jpg', title: '开启剑与雪的黑暗传说!', color: 'rgb(43, 35, 26)' },{ url: './images/slider03.jpg', title: '真正的jo厨出现了!', color: 'rgb(36, 31, 33)' },{ url: './images/slider04.jpg', title: '李玉刚:让世界通过B站看到东方大国文化', color: 'rgb(139, 98, 66)' },{ url: './images/slider05.jpg', title: '快来分享你的寒假日常吧~', color: 'rgb(67, 90, 92)' },{ url: './images/slider06.jpg', title: '哔哩哔哩小年YEAH', color: 'rgb(166, 131, 143)' },{ url: './images/slider07.jpg', title: '一站式解决你的电脑配置问题!!!', color: 'rgb(53, 29, 25)' },{ url: './images/slider08.jpg', title: '谁不想和小猫咪贴贴呢!', color: 'rgb(99, 72, 114)' }]//准备工作,获取元素const img = document.querySelector('.slider-wrapper img')const p = document.querySelector('.slider-footer p')const footer = document.querySelector('.slider-footer')//1.右按钮业务//1.1 获取右侧按钮const next = document.querySelector('.next')let i = 0 //信号量 控制播放图片张数//1.2 注册点击事件next.addEventListener('click', function() {//播放下一张图片i++if (i >= data.length) {//初始化为第一张i = 0}toggle()//1.3 得到对应的图片对象//1.4 渲染对应的对象// img.src = data[i].url// p.innerHTML = data[i].title// footer.style.backgroundColor = data[i].color// //1.5更换小圆点 先移除原来的类名,当前的li再添加active类名// document.querySelector('.slider-indicator .active').classList.remove('active')// document.querySelector(`.slider-indicator li:nth-child(${i + 1})`).classList.add('active')})//2.左侧按钮业务//2.1 获取左侧按钮const prev = document.querySelector('.prev')//2.2 注册点击事件prev.addEventListener('click', function() {//播放下一张图片i--if (i < 0) {//初始化为第一张i = data.length - 1}toggle()//1.3 得到对应的图片对象//1.4 渲染对应的对象// img.src = data[i].url// p.innerHTML = data[i].title// footer.style.backgroundColor = data[i].color// //1.5更换小圆点 先移除原来的类名,当前的li再添加active类名// document.querySelector('.slider-indicator .active').classList.remove('active')// document.querySelector(`.slider-indicator li:nth-child(${i + 1})`).classList.add('active')})//3.声明一个渲染的函数作为复用function toggle() {//1.3 得到对应的图片对象//1.4 渲染对应的对象img.src = data[i].urlp.innerHTML = data[i].titlefooter.style.backgroundColor = data[i].color//1.5更换小圆点 先移除原来的类名,当前的li再添加active类名document.querySelector('.slider-indicator .active').classList.remove('active')document.querySelector(`.slider-indicator li:nth-child(${i + 1})`).classList.add('active')}//4.自动播放模块let timerId = setInterval(function() {//利用JS,自动调用点击事件next.click()}, 1000)//5.鼠标经过大盒子暂停定时器,鼠标移动过大盒子后,开启定时器const slider = document.querySelector('.slider')//注册事件slider.addEventListener('mouseenter', function() {clearInterval(timerId)})slider.addEventListener('mouseleave', function() {//这个定时器相当于先开再关的timerId = setInterval(function() {//利用JS,自动调用点击事件next.click()}, 1000)})</script>
</body></html>

相关文章:

5.2 JavaScript 案例 - 轮播图

JavaScript - 轮播图 文章目录 JavaScript - 轮播图基础模版一、刷新页面随机轮播图案例二、轮播图 定时器版三、轮播图完整版 基础模版 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8" /><meta http-equiv"…...

使用IP自签名SSL证书

最近需要创建WebSocket服务器并使用SSL证书&#xff0c;由于是内网测试&#xff0c;所以需要使用指定IP的自签SSL证书。 其实笔者前面博文 使用nexus3作为Docker镜像仓库 解决nexus3登录x509: certificate has expired or is not yet valid 中有创建过相应的证书&#xff0c;这…...

数据库中的运算符

1.算术运算符 算术运算符主要用于数学运算&#xff0c;其可以连接运算符前后的两个数值或表达式&#xff0c;对数值或表达式进行加&#xff08;&#xff09;、减&#xff08;-&#xff09;、乘&#xff08;*&#xff09;、除&#xff08;/&#xff09;和取模&#xff08;%&…...

定制erp真的很贵吗?

定制ERP真的很贵吗&#xff1f;这个问题&#xff0c;相信很多企业在考虑是否实施ERP系统时&#xff0c;都会纠结。特别是对于一些中小型企业&#xff0c;预算有限&#xff0c;心里总会有个疑问&#xff1a;花大价钱定制一个系统&#xff0c;真的值得吗&#xff1f;其实&#xf…...

Java Integer的数值比较

文章目录 环境问题答案说明解决办法其它总结 环境 Windows 11 专业版Java 21 问题 下面这段代码的运行结果是什么&#xff1f; Integer i1 0;int i2 0;for (int n 0; n < 200; n) {if (i1 ! i2) {System.out.println("i1 " i1 ", i2 " i2);b…...

QGroundControl之5-AppSettings.cc

介绍 应用程序设置 Application Settings &#xff0c;这里看下语言选择功能&#xff0c;它是怎么和json文件关联起来的&#xff0c;刚刚看的时候&#xff0c;很是奇怪这么多的json文件作用。 1.AppSettings.cc 文件怎么和App.SettingsGroup.json关联 在AppSettings.cc文件没…...

Django Fixtures 使用指南:JSON 格式详解

在Django开发中&#xff0c;fixtures是一种非常有用的工具&#xff0c;它们可以帮助我们序列化数据库内容&#xff0c;并在不同的环境或测试中重用这些数据。本文将详细介绍Django fixtures的概念、如何生成和使用JSON格式的fixtures。 什么是Fixtures&#xff1f; Fixtures是…...

单元测试SpringBoot

添加测试专用属性 加载测试专用bean Web环境模拟测试 数据层测试回滚 测试用例数据设定...

邮件营销平台应如何提升外贸开发信的效果?

邮件营销平台在外贸中优势包括高效市场定位、成本效益、增强客户关系、实时反馈优化、全球覆盖及时区优化、环保可持续性。Geeksend邮件营销是强大平台&#xff0c;高效管理&#xff0c;精准销售&#xff0c;把握外贸市场的每一个机遇&#xff0c;助力外贸企业精准定位、简化管…...

绘制折线图遇到问题记录

绘制折线图 主要参考&#xff1a;https://blog.csdn.net/qq_38029916/article/details/121611066 对应代码 import csv import matplotlib.pyplot as plt import pandas as pd import numpy as np plt.rcParams[font.sans-serif] [SimHei] plt.rcParams[font.family] sans…...

python 调Qt C++ 写法配置和坑点

python 示例写法 和调c动态库一样 通过回调函数方式 将python函数注册到c 动态库中 from ctypes import *def DllCall(nParam, nFlag):print(nParam, nFlag)z2 0.6z3 0.4z4 0.0z5 0.3z6 0.5z7 0.8z8 0.3z9 0.9strData str(z2) str(z3) str(z4) str(z5)…...

css设置透明的几种办法

在CSS中&#xff0c;有几种方法可以设置元素的透明度。以下是主要的几种方式&#xff1a; 1. 使用 opacity 属性 定义&#xff1a;opacity 属性用于设置元素的整体透明度&#xff0c;包括其内容和背景。取值范围&#xff1a;取值从0&#xff08;完全透明&#xff09;到1&…...

刷题日志【4】

目录 1、猜数字大小 1、猜数字大小 题意有点抽象&#xff0c;我大概讲一下&#xff0c;就是在1——n里面会有一个目标数&#xff0c;我们通过猜数字的方式逼近这个数字&#xff0c;直到解出这个数&#xff0c;之前我们是用二分法求最快达到求解的问题&#xff0c;这道题多了每…...

如何制作自己的字体文件.ttf

日常编程中&#xff0c;一些常用的符号可以直接用来当做图标使用&#xff0c;不需要引入过多的资源文件&#xff08;例如&#xff1a;ico、png、svg等&#xff09;十分方便&#xff01; 笔者发现iconfont网站可以选择自己需要的图标&#xff0c;制作成.ttf文件来直接使用&…...

gradle在IDEA 中无法使用的启动守护线程的问题

最近打开一个比较早的项目&#xff0c;Gradle 配置没有问题&#xff0c;IDEA 打开Java项目却不能初始化守护线程&#xff0c;UI 上只能看到失败&#xff0c;看不到具体原因。 首先尝试了升级最新的gradle 版本8.11, 实际上这个版本在本地命令行都不能正常工作&#xff0c;没有…...

Spring Boot 配置多数据源并手动配置事务

Spring Boot 配置多数据源并手动配置事务 一、为什么多数据源需要手动配置&#xff1f;二、配置多数据源1. 数据源配置类 (DataSourceConfig)2. 主数据库 MyBatis 配置类 (PrimaryDbMyBatisConfig)3. 从数据库 MyBatis 配置类 (SecondaryDbMyBatisConfig)4. application.yml 配…...

YashanDB 23.2 YAC 共享集群部署和使用自带YMP迁移工具进行数据迁移,效果很city

1. 环境准备 本文以经典架构&#xff08;2 台服务器&#xff0c;1 共享存储且包含 3 个及以上 LUN&#xff09;为例&#xff0c;搭建双实例单库的共享集群环境。 主机名 IP 版本 CPU 内存 硬盘 用途 yac1 192.168.50.60 Kylin-Server-V10-SP3 4C 8G 100G YAC 集群…...

【数学】矩阵的逆与伪逆 EEGLAB

文章目录 前言matlab代码作用EEGLAB 中的代码总结参考文献 前言 在 EEGLAB 的使用中&#xff0c;运行程序时出现了矩阵接近奇异值&#xff0c;或者缩放错误。结果可能不准确。RCOND 1.873732e-20 的 bug&#xff0c;调查 EEGLAB 后发现是 raw 数据的问题。 matlab代码 A_1 …...

狐猬编程 C++ L3 第7课 字符串入门 元音字母

给你一个所有字符都是字母的字符串&#xff0c; 请输出其中元音字母的个数。&#xff08;提示&#xff1a; 二十六个字母中的五个元音字母是 a&#xff0c; e&#xff0c; i&#xff0c; o&#xff0c; u; 所有字符有大小写区别。&#xff09; 输入格式 仅一行&#xff0c; 包…...

APP UI自动化测试的思路小结

在移动互联网飞速发展的今天&#xff0c;APP质量直接影响用户体验。为了保障UI功能的稳定性和一致性&#xff0c;APP UI自动化测试已经成为各大企业必不可少的一环。那么如何设计一套高效的测试方案&#xff1f;本篇为你总结关键思路&#xff01; 如何从零构建UI自动化测试&am…...

AI-调查研究-01-正念冥想有用吗?对健康的影响及科学指南

点一下关注吧&#xff01;&#xff01;&#xff01;非常感谢&#xff01;&#xff01;持续更新&#xff01;&#xff01;&#xff01; &#x1f680; AI篇持续更新中&#xff01;&#xff08;长期更新&#xff09; 目前2025年06月05日更新到&#xff1a; AI炼丹日志-28 - Aud…...

Cursor实现用excel数据填充word模版的方法

cursor主页&#xff1a;https://www.cursor.com/ 任务目标&#xff1a;把excel格式的数据里的单元格&#xff0c;按照某一个固定模版填充到word中 文章目录 注意事项逐步生成程序1. 确定格式2. 调试程序 注意事项 直接给一个excel文件和最终呈现的word文件的示例&#xff0c;…...

树莓派超全系列教程文档--(62)使用rpicam-app通过网络流式传输视频

使用rpicam-app通过网络流式传输视频 使用 rpicam-app 通过网络流式传输视频UDPTCPRTSPlibavGStreamerRTPlibcamerasrc GStreamer 元素 文章来源&#xff1a; http://raspberry.dns8844.cn/documentation 原文网址 使用 rpicam-app 通过网络流式传输视频 本节介绍来自 rpica…...

PHP和Node.js哪个更爽?

先说结论&#xff0c;rust完胜。 php&#xff1a;laravel&#xff0c;swoole&#xff0c;webman&#xff0c;最开始在苏宁的时候写了几年php&#xff0c;当时觉得php真的是世界上最好的语言&#xff0c;因为当初活在舒适圈里&#xff0c;不愿意跳出来&#xff0c;就好比当初活在…...

IGP(Interior Gateway Protocol,内部网关协议)

IGP&#xff08;Interior Gateway Protocol&#xff0c;内部网关协议&#xff09; 是一种用于在一个自治系统&#xff08;AS&#xff09;内部传递路由信息的路由协议&#xff0c;主要用于在一个组织或机构的内部网络中决定数据包的最佳路径。与用于自治系统之间通信的 EGP&…...

条件运算符

C中的三目运算符&#xff08;也称条件运算符&#xff0c;英文&#xff1a;ternary operator&#xff09;是一种简洁的条件选择语句&#xff0c;语法如下&#xff1a; 条件表达式 ? 表达式1 : 表达式2• 如果“条件表达式”为true&#xff0c;则整个表达式的结果为“表达式1”…...

linux arm系统烧录

1、打开瑞芯微程序 2、按住linux arm 的 recover按键 插入电源 3、当瑞芯微检测到有设备 4、松开recover按键 5、选择升级固件 6、点击固件选择本地刷机的linux arm 镜像 7、点击升级 &#xff08;忘了有没有这步了 估计有&#xff09; 刷机程序 和 镜像 就不提供了。要刷的时…...

OkHttp 中实现断点续传 demo

在 OkHttp 中实现断点续传主要通过以下步骤完成&#xff0c;核心是利用 HTTP 协议的 Range 请求头指定下载范围&#xff1a; 实现原理 Range 请求头&#xff1a;向服务器请求文件的特定字节范围&#xff08;如 Range: bytes1024-&#xff09; 本地文件记录&#xff1a;保存已…...

[10-3]软件I2C读写MPU6050 江协科技学习笔记(16个知识点)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16...

C++中string流知识详解和示例

一、概览与类体系 C 提供三种基于内存字符串的流&#xff0c;定义在 <sstream> 中&#xff1a; std::istringstream&#xff1a;输入流&#xff0c;从已有字符串中读取并解析。std::ostringstream&#xff1a;输出流&#xff0c;向内部缓冲区写入内容&#xff0c;最终取…...