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

电子商务网站建设教案seo北京公司

电子商务网站建设教案,seo北京公司,免费建设互动的网站,做网站的 深圳背景: 前端的设计效果,越来越炫酷,而这些炫酷的效果,利用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.hkea.cn/news/860330/

相关文章:

  • 淘宝优惠券怎么做网站网络服务提供商
  • 哪里有网站建设电话查排名官网
  • 做网站需要准备的工具网络营销方案模板
  • 科技未来网站建设百度推广开户公司
  • 十度网站建设保定网站推广公司
  • php可以做视频网站有哪些软文推广渠道主要有
  • 成都网站建设桔子科技淘宝付费推广有几种方式
  • 福田的网站建设公司网络营销成功案例ppt免费
  • 网站建设英文专业术语百度推广网址
  • 做网站之前需要准备什么企业网络营销策划案
  • dreamweaver动态网站开发与设计教程内容怎么在百度上面打广告
  • 济南网站搜索优化深圳网络推广招聘
  • 网站 色彩武汉it培训机构排名前十
  • 怎么做资源网站网络培训中心
  • 服装品牌网站建设营销网站建设选择原则
  • 乌鲁木齐新市网站建设有哪些网络营销公司
  • 网站的后台怎么做企业网络规划设计方案
  • 做网站文字字号大小企业网站设计要求
  • ae有么有做gif的网站品牌推广方案范文
  • apicloud官网下载seo关键词优化排名公司
  • 上海网站制作福州百度关键字优化精灵
  • 做uml图网站百度账号快速注册入口
  • 广西梧州南京 seo 价格
  • 网站警察备案seo关键词优化平台
  • 网站开发设计实训 报告惠州网站建设
  • 网站开发的原理山西免费网站关键词优化排名
  • 石家庄网站建设全包免费推广网站2024
  • 阿里云网站备案时间无锡seo网站管理
  • 景点介绍网站模板重庆百度关键词推广
  • 做亚马逊网站费用吗曲靖新闻今日头条