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

建设网站后需要什么知识写作网站挣钱对比

建设网站后需要什么知识,写作网站挣钱对比,群晖安装 wordpress,网站seo问题诊断工具JSCSS实现滑动轮播图 使用JS加CSS来实现的幻灯片&#xff0c;主要使用的是CSS的transform属性中的translate来实现&#xff0c;适合与用户交互的轮播图&#xff0c;展现轮播图的数量&#xff0c;用户可自由进行选择。 <!DOCTYPE html> <html lang"en">&…

 JS+CSS实现滑动轮播图

使用JS加CSS来实现的幻灯片,主要使用的是CSS的transform属性中的translate来实现,适合与用户交互的轮播图,展现轮播图的数量,用户可自由进行选择。

<!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>Document</title><style>* {margin: 0;padding: 0;list-style: none;}.cardBox {width: 600px;height: 300px;box-shadow: 0 0 10px gray;border-radius: 5px;margin: 100px auto;position: relative;overflow: hidden;}.imgBox {width: 3600px;height: 300px;transition: all 1s;transform: translateX(0px);}.item {width: 600px;height: 300px;float: left;}.item img {width: 100%;}.btn {width: 20px;height: 20px;top: calc(50% - 20px);border-right: solid white;border-top: solid white;position: absolute;z-index: 99;opacity: .6;cursor: pointer;}.btn:hover {opacity: 1;}.left {left: 15px;transform: rotate(-135deg);}.right {right: 15px;transform: rotate(45deg);}.pointBox {display: flex;width: 50%;position: absolute;bottom: 15px;left: 50%;transform: translateX(-50%);justify-content: center;}.pointBox li {width: 8px;height: 8px;border-radius: 50%;background: gray;margin: 0 10px;opacity: .7;cursor: pointer;}.pointBox li:hover {opacity: 1;background-color: white;}</style>
</head><body><div class="cardBox"><div class="btn left"></div><div class="btn right"></div><ul class="imgBox"><li class="item"><img src="https://img2.baidu.com/it/u=2988589017,2923917558&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800" alt=""></li><li class="item"><img src="https://img2.baidu.com/it/u=3867960631,2923014190&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500" alt=""srcset=""></li><li class="item"><img src="https://img0.baidu.com/it/u=891036130,2043934807&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500" alt=""srcset=""></li><li class="item"><img src="https://img1.baidu.com/it/u=1304255642,2961408783&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500" alt=""srcset=""></li><li class="item"><img src="https://img0.baidu.com/it/u=3822016102,3026244821&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=281" alt=""srcset=""></li><li class="item"><img src="https://img1.baidu.com/it/u=847956157,2750448390&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500" alt=""srcset=""></li></ul><ul class="pointBox"><li></li><li></li><li></li><li></li><li></li><li></li></ul></div><script>let card = document.querySelector('.cardBox ul')let cardBox = document.querySelector('.cardBox')let items = document.querySelectorAll(".item")let leftBtn = document.querySelector(".left")let rightBtn = document.querySelector(".right")let points = document.querySelectorAll(".pointBox li")let index = 0items.forEach((item, index) => {let translateX = index * 600item.style.left = `${translateX}px`})let timer = nullpoints[index].style.background = 'white'points[index].style.width = '16px'points[index].style.borderRadius = '5px'const initInterval = () => {timer = setInterval(() => {index++let pointIndex = index;points[pointIndex].style.background = 'white'points[pointIndex].style.width = '16px'points[pointIndex].style.borderRadius = '5px'if (pointIndex == 0) {points[5].style.background = 'gray'points[5].style.width = '8px'} else {points[pointIndex - 1].style.background = 'gray'points[pointIndex - 1].style.width = '8px'}let translateX = -index * 600card.style.transform = `translateX(${translateX}px)`if (index >= 5) {index = -1}}, 3000);}initInterval()cardBox.addEventListener("mouseover", () => {clearInterval(timer)})cardBox.addEventListener("mouseout", () => {initInterval()})// btn.addEventListener("mouseout", () => {//   initInterval()// })leftBtn.onclick = function () {if (timer) {clearInterval(timer)}if (index <= 0) {index = 6}index--let translateX = -index * 600card.style.transform = `translateX(${translateX}px)`}rightBtn.onclick = function () {if (timer) {clearInterval(timer)}index++let translateX = -index * 600card.style.transform = `translateX(${translateX}px)`if (index >= 5) {index = -1}}points.forEach((item, i) => {item.onclick = () => {points.forEach(element => {element.style.background = 'gray'element.style.width = '8px'element.style.borderRadius = '50%'});item.style.background = 'white'item.style.width = '16px'item.style.borderRadius = '5px'index = i;let translateX = -index * 600card.style.transform = `translateX(${translateX}px)`}})</script>
</body></html>

 

 

JS+CSS实现浅入浅出轮播图

使用CSS的动画属性以及透明度属性来进行设置,显示轮播图数量,通过点击轮播图中的索引点来切换轮播图。适合需要和用户交互的简单轮播图

http://www.yayakq.cn/news/142157/

相关文章:

  • 学校网站要求WordPress百度收录内容
  • wordpress 站点收录建立和创立的区别
  • 微知微网站建设实训平台郑州建设企业网站找哪个公司
  • 怎样把网站打包做百度小程序有个做图片mv的网站56
  • 网站建设方案 备案怎么查询网站有没有做网站地图
  • 游戏充值网站怎么做Wordpress幻灯片滑块设置
  • 怎么做游戏门户网站vs做网站各种控件的使用
  • 网站jquery上传源代码seo具体怎么优化
  • 西安外贸网站开发安徽万户网络
  • 郑州网站建设居易国际餐饮营销方案
  • 最好的网页设计网站网站设计公司网站
  • 微网站一键导航上海优化排名推广
  • 网站表现形式手机网站设计论文
  • 自己做烘焙的网站怎么做套板网站
  • 毕业设计怎么做网站建筑工程公司有哪些
  • 网站的后台在哪儿陕西省建设部网站
  • 萧山网站制作公司攀枝花建设工程质量监督站投诉网站
  • dede网站后缀乱码网站每年需要续费吗
  • 网站建站公司公告广州建立网站
  • 做app和网站怎样一键生成静态网页
  • 大连建站免费模板百度推广后台管理
  • 做网站横幅用什么软件好wordpress 邮件 key
  • 网站seo方案策划书c语言精品网站开发的教学
  • 九一人才网招聘网官方网站增长超人网站建设价格
  • 网站开发需求分析的内容有没有网站
  • 网站流量统计表建筑人才网官网网址
  • 如何制作一个论坛网站北京十大网站建设公司
  • 网站主体负责人短视频app软件下载大全
  • 东莞网站建设企慕cms进行网站开发
  • 上海全国网站建设邢台手机网站建设