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

白山市网站建设_网站建设公司_MySQL_seo优化

中国建设部网站办事大厅,德阳小程序开发,软件管理app,网易搜索引擎实现思路#xff1a;卡片移动使用css的translateY属性实现#xff0c;每个卡片从最下面移动到最上面#xff0c;然后直接移动到最下面#xff0c;每次改变的位移是固定的#xff0c;假设每次移动50px#xff0c;当移动到最小时#xff0c;就让translataY为0#xff0c;…实现思路卡片移动使用css的translateY属性实现每个卡片从最下面移动到最上面然后直接移动到最下面每次改变的位移是固定的假设每次移动50px当移动到最小时就让translataY为0但是一定要进行初始化每个div的初始位置 代码 templatediv iddemodiv classbox!-- 左下角预警 --divclasswarning:refsetItemRef:style{transform: translateY(${-index * 50}px),transition: transform 0.9s ease,zIndex: ${-index 100}}v-for(item, index) in warningInfoListdiv classwarning-title{{ item.warning_type }}/divdiv classwarning-content :style{display: index ! 0 ?none:block}div classwarning-time{{ item.time }}/divdiv classwarning-word{{ item.warning_content }}/div/div/div/div/div /templatescript setup import { reactive, ref, computed, onMounted, onUnmounted, nextTick } from vue// let warningInfoList ref([ // { warning_type: 台风, warning_content: 大风注意安全, time: 12日-13 }, // { warning_type: 暴雨, warning_content: 暴雨注意安全, time: 12日-13 }, // { warning_type: 冰雹, warning_content: 冰雹注意安全, time: 12日-13 } // ]) import {warningInfo} from renderer/api/index.ts; //预警数据 let warningInfoList ref([]) const getWarningInfo async () {let response await warningInfo({})warningInfoList.value response.data.ret.resultslet maxLength warningInfoList.value.lengthnextTick(() {setInterval(() {warningInfoList.value.forEach((item, index) {let aTransformY parseInt(itemRefs[index].style.transform.substring(11))let bIndex itemRefs[index].style.zIndex// console.log(aTransformY,aTransformY);if (aTransformY -((maxLength - 1) * 50)) {aTransformY 0itemRefs[index].children[1].style.display block} else {aTransformY - 50itemRefs[index].children[1].style.display none}if(bIndex (100 - maxLength1)){bIndex 100}else {bIndex - 1}itemRefs[index].style.transform translateY(${aTransformY}px)itemRefs[index].style.zIndex bIndex// console.log(itemRefs[index], itemRefs[index].style)})}, 3000)}) }const itemRefs [] const setItemRef (el) {if (el) {itemRefs.push(el)} } // console.log(itemRefs,itemRefs); onMounted(async () {await getWarningInfo()//初始化// nextTick(() {// setInterval(() {// warningInfoList.value.forEach((item, index) {// let aTransformY parseInt(itemRefs[index].style.transform.substring(11))// let bIndex itemRefs[index].style.zIndex// console.log(aTransformY,aTransformY);// // debugger// if (aTransformY -((maxLength - 1) * 50)) {// aTransformY 0// itemRefs[index].children[1].style.display block// } else {// aTransformY - 50// itemRefs[index].children[1].style.display none// }// if(bIndex (100 - maxLength1)){// bIndex 100// }else {// bIndex - 1// }// itemRefs[index].style.transform translateY(${aTransformY}px)// itemRefs[index].style.zIndex bIndex// // console.log(itemRefs[index], itemRefs[index].style)// })// }, 3000)// }) }) /scriptstyle langless scoped #demo {position: absolute;left: 40px;bottom: 30px;.box {width: 301px;height: 360px;// overflow: scroll;position: relative;.warning {width: 301px;height: 280px;position: absolute;.warning-title {height: 40px;background-image: url(../assets/img/title_bg.png);font-size: 18px;font-family:PingFang SC,PingFang SC-700;font-weight: 700;color: #ff6838;line-height: 40px;padding-left: 60px;}.warning-content {height: 240px;border-radius: 0px 0px 8px 8px;padding-top: 20px;box-sizing: border-box;background: rgba(255, 245, 209, 0.9); .warning-time {height: 30px;font-size: 20px;font-family:PingFang SC,PingFang SC-400;font-weight: 500;color: #009f80;line-height: 30px;padding-left: 20px;box-sizing: border-box;position: relative;::before {display: block;content: ;width: 3px;height: 3px;border-radius: 50%;background-color: #009f80;position: absolute;top: 50%;left: 3%;}}.warning-word {padding: 20px 30px;box-sizing: border-box;font-size: 20px;font-family:PingFang SC,PingFang SC-400;font-weight: 400;color: #313737;line-height: 30px;}}}} } /style如何没有接口可以使用里面的假数据先测试
http://www.ihoyoo.com/news/23449.html

相关文章:

  • 俄语在线网站制作建设信用网站的目的
  • pycharm 做网站七牛图床wordpress
  • 企业网站开发技术有哪些wordpress手动升级插件
  • 新宫网站建设公司优秀高端网站建设服务商
  • 大型网站建设公司沈阳深圳工程建设有限公司
  • 微信网站开发哪家好北京官网建设哪家好
  • 网站首页怎么做pswordpress json插件
  • 淘宝做导航网站好如何设计出更好用户体验的网站
  • 网站建设一般需要多少费用网站上360 旋转的图是怎么做的
  • 政务网站优化专业建设网站技术
  • 旅游网站开发目的旅游最新资讯 新闻
  • 在线营销型网站制作富蕴县建设局网站
  • 企业网站建设费用属于什么科目房地产行业政策
  • 上海网站公网站建设技术是什么
  • 建设c2c网站需要多少投资浙江标力建设集团网站
  • 自己可以建设网站吗个人网站 云服务器
  • 国外网站布局网站建设素材网页
  • 章丘网站建设长沙专业seo优化推荐
  • 网站设置文件夹权限设置网站建设小程序公众号销售
  • 即墨网站建设电话wordpress电子书主题
  • 重庆网站排名优化公司南平企业网站建设
  • 网站建设套模版拉新推广变现app
  • 专业视频网站开发公司wordpress svg
  • 企业营销网站模板企业宣传片公司
  • 安徽工程建设信息网站6我的网站模板下载 迅雷下载 迅雷下载
  • 地区汽车修理网站建设广告商对接平台
  • 网站怎么样排名如何寻找外贸公司订单
  • 简易的网站制作wordpress清楚所有评论
  • qq号码提取网站上海工程建设信息网官网
  • 网站制作 深圳信科网络泉州建站模板源码