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

公司网站制作平台公司网站申请书

公司网站制作平台,公司网站申请书,平台推广策划,深圳市建设有限公司背景: 前端的设计效果,越来越炫酷,而这些炫酷的效果,利用css3的动画效果和js就可以实现,简单的代码就能实现非常炫酷的效果。 原理: 利用 js监控scrollTop的位置,通过 top定位图片的位置&#x…

背景: 前端的设计效果,越来越炫酷,而这些炫酷的效果,利用css3的动画效果和js就可以实现,简单的代码就能实现非常炫酷的效果。
原理: 利用 js监控scrollTop的位置,通过 top定位图片的位置,实现视差的滚动;当滚动到目标位置时,通过css3的animation属性,实现抖动效果。

一、预览效果

视差抖动

相关素材照片:
在这里插入图片描述

在这里插入图片描述

二、相关代码

style部分:

<style>.index-module--nftBox--3H_AP {height: 200vh;background-repeat: no-repeat;background-size: cover;background-position: 50%;width: 100%;}.index-module--moto--3sEm1 {position: absolute;left: 0;top: -400px; /*汽车模型初始化位置定点*/background-image: url(https://resource.nreal.cn/web/images/home/motuo.png);/*汽车图片*/transition: .5s;-webkit-transform: translate(0);transform: translate(0);}.index-module--moto--3sEm1.is-active{ /*汽车模型的抖动效果*/animation: jump .1s ease-in-out 5 alternate;}@keyframes jump {/*汽车模型的抖动效果*/from { top: -30px; }to { top: 6px }}.index-module--moto--3sEm1, .index-module--nftBox--3H_AP {height: 200vh;background-repeat: no-repeat;background-size: cover;background-position: 50%;width: 100%;}.index-module--title--rSrVs {opacity: 1;width: 80%;margin: 0 auto;}.index-module--titleBox--1VS2L {height: 50vh;display: flex;justify-content: center;align-items: center;position: absolute;top: 0;left: 50%;-webkit-transform: translate(-50%);transform: translate(-50%);}.hoZaHW {animation-name: ewofWB;animation-duration: 300ms;animation-iteration-count: infinite;transform-origin: center center;animation-play-state: running;}/* @keyframes ewofWB {0%   { left:0px; top:0px;}25%  { left:200px; top:0px;}50%  { left:200px; top:200px;}75%  { left:0px; top:200px;}100% { left:0px; top:0px;}} */.index-module--nftTitle--20OyY {width: 100%;max-width: 800px;}.index-module--duang--5jpDr {-webkit-animation: index-module--circleP--3P-V7 1.3s;animation: index-module--circleP--3P-V7 1.3s;-webkit-transform: translateY(400px);transform: translateY(400px);}.index-module--moto--3sEm1 {position: absolute;left: 0;-webkit-transform: translate(0);transform: translate(0);}  </style>

html部分:

<div id="layout-container" class="content"><div class="index-module--nftBox--3H_AP" style="background-image:url(https://resource.nreal.cn/web/images/home/motuobg.jpg)"><div class="index-module--nftBox--3H_AP"></div><div class="index-module--moto--3sEm1" id="scrollup"></div><div class="index-module--title--rSrVs index-module--titleBox--1VS2L"><div dur="300" class="sc-bdVaJa hoZaHW"><img src="https://resource.nreal.cn/web/images/home/title.png" class="index-module--nftTitle--20OyY"></div></div></div>
</div>

js部分:

<script type="text/javascript">window.onscroll= function(){//变量t是滚动条滚动时,距离顶部的距离var t = document.documentElement.scrollTop||document.body.scrollTop;var scrollup = document.getElementById('scrollup');//当滚动到距离顶部200px时if(t>=200){             scrollup.style.backgroundImage="url(https://resource.nreal.cn/web/images/home/motuo.png)";scrollup.style.top=6+"px";  if(scrollup.style.top == '6px'){document.getElementById("scrollup").classList.add("is-active")}}else{//恢复正常               scrollup.style.backgroundImage="url(https://resource.nreal.cn/web/images/home/motuo.png)";scrollup.style.top=-400+"px";document.getElementById("scrollup").classList.remove("is-active")}}
</script>
http://www.yayakq.cn/news/903503/

相关文章:

  • 网站的ftp别的公司会给么贵港北京网站建设
  • 网站更改文章标题html跳转到另一个html页面
  • 微信分销网站建设哪家好上一篇 下一篇 wordpress
  • 企业网站建设公司地址邢台搜
  • 网站网站开发建设网站轮播效果怎么做
  • 隆昌市住房和城乡建设厅网站wordpress yosat
  • 新塘网站seo优化什么是网站托管
  • 住房和城乡建设报名网站深圳市律师网站建设怎么样
  • 如果自己做网站卖设备中国网站制作企业排行榜
  • 网站的数据库怎么做做设计图的网站
  • 重庆怎么在网站上做广告巢湖商城网站建设
  • 门户网站应该怎么做wordpress for sae 3.9
  • 中兴建设云南有限公司网站公司注册地址怎么写
  • 免费网站分析seo报告是坑吗免费网站建设哪个好
  • 做网站的难题市场调研方案
  • 怎么自己的电脑做网站查域名地址
  • 提供邢台企业做网站西宁房地产网站建设
  • 个人资料库网站怎么做宝安网站建设信科免费
  • 建筑工程资料网站网站建设公司何去何从
  • 单页网站产品网站做专业团队
  • 海外网络服务商seo计费系统开发
  • 网站结构的规划与设计天天seo伪原创工具
  • 兰州网站建设哪家好郑州免费网站建设哪家好
  • 自己怎样做网站公司网站续费一年多少钱
  • 优化网站推广教程排名wordpress首页添加图片不显示
  • 关于dw做网站网络设计包括哪些方面
  • 买了网站模版怎么做制作视频的软件哪个最好免费的
  • 网站内容被删除怎么取消收录微信小程序安装
  • 怎么制作一个网站企业网站seo网址
  • 电商网站建站开发语言公司邮箱怎么在手机上登录