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

大兴企业官网网站建设广州seo优化

大兴企业官网网站建设,广州seo优化,高校两学一做网站建设,网站解析后 问题效果如下gif 只进行了基础的事件和布局,可优化的地方:luminance-box这个div加上后,由于和slider-run-way都是absolute定位,导致slider-run-way的点击事件无法设置值,只能通过滑块设置。暂时想不到咋处理,有…

效果如下gif

只进行了基础的事件和布局,可优化的地方:luminance-box这个div加上后,由于和slider-run-way都是absolute定位,导致slider-run-way的点击事件无法设置值,只能通过滑块设置。暂时想不到咋处理,有想法可以讨论一下

html布局

<div class="light-slider"><divclass="slider-run-way"@click.stop="handleClickRunway($event)"ref="runwayRef"><div class="active-bar" :style="{ width: activeWidth + '%' }"></div><divclass="control-wrapper":style="{ left: activeWidth + '%' }"@mousedown="handleMousedown($event)"><div class="control-btn"><span></span><span></span></div></div></div><div class="luminance-box" @click="handleRight"><img src="../../../../assets/home/homepage_control_bright.png" /><div class="right-box"><span class="num">{{ activeWidth }}%</span><span class="l-title">luminance</span></div></div></div>

js部分

export default {name: "lightingControl",props: {isDisabled: {type: Boolean,default: true,},},data() {return {activeWidth: 13,runWayWidth: 0, // 滑道总宽度startX: 0,dragging: false,isClick: true,startPosition: 0,};},mounted() {this.$nextTick(() => {this.runWayWidth = this.$refs.runwayRef.clientWidth;});},methods: {handleClickRunway(e) {if (!this.isClick || this.isDisabled) return;console.log(e);const { runWayWidth } = this;const { offsetX } = e;const percent = parseInt((offsetX / runWayWidth) * 100);this.activeWidth = percent;},handleRight(e) {return false;},handleMousedown(e) {if (this.isDisabled) return;e.preventDefault();this.startX = e.clientX;this.onDragStart(e);window.addEventListener("mousemove", this.onDragging);window.addEventListener("mouseup", this.onDragEnd);},onDragStart(e) {this.dragging = true;this.isClick = true;this.startPosition = parseFloat(this.activeWidth);},onDragging(e) {e.stopPropagation();if (this.dragging) {this.isClick = false;let currentX = e.clientX;let diff = ((currentX - this.startX) / this.runWayWidth) * 100;this.newPosition = this.startPosition + diff;this.setPosition(this.newPosition);}},onDragEnd() {if (this.dragging) {setTimeout(() => {this.dragging = false;if (!this.isClick) {this.setPosition(this.newPosition);this.isClick = true;}}, 0);window.removeEventListener("mousemove", this.onDragging);window.removeEventListener("mouseup", this.onDragEnd);}},setPosition(newPosition) {if (newPosition < 0) {newPosition = 0;} else if (newPosition > 100) {newPosition = 100;}this.activeWidth = Math.round(newPosition);},},
};

css


.light-slider {margin-top: 16px;position: relative;.slider-run-way {width: 100%;position: relative;cursor: pointer;height: 70px;background: #d7eeff;border-radius: 4px 4px 4px 4px;.active-bar {height: 100%;position: absolute;left: 0;border-top-left-radius: 4px;border-bottom-left-radius: 4px;background: #36c1fd;}.control-wrapper {display: flex;align-items: center;justify-content: center;height: 30px;width: 22px;position: absolute;user-select: none;z-index: 1001;top: 20px;transform: translateX(-50%);background-color: transparent;.control-btn {width: 16px;height: 24px;background: #fff;box-shadow: 0px 0px 5px 0px rgba(76, 115, 184, 0.5);border-radius: 2px 2px 2px 2px;color: #36c1fd;display: flex;align-items: center;justify-content: space-evenly;span {width: 2px;height: 6px;background: #36c1fd;border-radius: 30px 30px 30px 30px;}}}}.luminance-box {display: flex;width: 100%;height: 70px;justify-content: space-between;align-items: center;position: absolute;left: 0;top: 0;img {width: 20px;height: 20px;margin-left: 14px;}.l-title {font-size: 14px;}.right-box {color: #2e2e48;display: flex;flex-direction: column;align-items: center;font-weight: bolder;margin-right: 10px;.num {font-size: 24px;}}}
}

http://www.ds6.com.cn/news/10439.html

相关文章:

  • 如何做响应式网站设计搜索seo引擎
  • 珠海网站建设公司哪个好模板建站网页
  • 网站面包屑怎么做如何推广自己产品
  • 西安病毒感染最新消息福州短视频seo
  • 网站做博彩反向代理违法郑志平爱站网创始人
  • 发布企业信息的网站百度登录个人中心官网
  • vue php 哪个做网站 好域名注册网站
  • 慈溪做无痛同济 amp 网站怎样策划一个营销型网站
  • 网站跟网页的区别独立站平台选哪个好
  • wordpress导入xls搜索引擎优化包括哪些
  • 亚网站建设免费做网站推广的软件
  • 如何建网络营销网站资源网站优化排名软件公司
  • 珠海网站建设防百度官网认证免费
  • 用word文档做网站软文文案范文
  • python做网站点登入没反映口碑营销5t理论
  • 广州做网站开发网络推广的方式有哪些
  • 国内最有趣的25个网站zac博客seo
  • 网站开发需要解决难题搜索关键词排名查询
  • 赣州企业网站在那做太原网站制作优化seo公司
  • 基于java框架的网站开发线上推广是什么意思
  • 企业为什么要建立网站小红书关键词优化
  • 庆阳市建设局门户网站百度代理推广
  • 四川教育公共信息服务平台seo有哪些经典的案例
  • 网站关键词没被搜出来百度分公司
  • 邹城网站建设zczwxx外贸网站设计
  • vestacp配置wordpress搜索引擎优化规则
  • 网站后台怎么给图片做水印seo关键词是什么
  • 龙果学院大型网站稳定性建设2022年最新最有效的营销模式
  • 北京建设信源资讯有限公司网站宁波谷歌seo
  • 工作室和公司的区别长春seo技术