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

网站开发学徒工作如何二维码生成器怎么弄

网站开发学徒工作如何,二维码生成器怎么弄,上海专业建设网站,百度网页版微信效果展示 键盘未弹起时 键盘弹起后#xff1a; 实现方式 话就不多说了 我直接贴代码了 原理就是用你点击的输入框的底部 距离顶部的位置 减去屏幕高度除以2#xff0c;然后设成负值#xff0c;再将这个值给到最外层相对定位的盒子的top属性#xff0c;这样就不会出现顶…效果展示 键盘未弹起时 键盘弹起后 实现方式 话就不多说了 我直接贴代码了 原理就是用你点击的输入框的底部 距离顶部的位置 减去屏幕高度除以2然后设成负值再将这个值给到最外层相对定位的盒子的top属性这样就不会出现顶部导航上移的问题了具体实现如下 首先封装一个js工具包这个包其实有很多东西的但是对键盘没什么用我就去掉了是一个设备工具类没事的话可以去研究设备工具类在开发的过程中还是用处比较大的。 工具类实现 /*** 设备工具类*/ class DeviceUtil {/*** 获取当前环境 开发工具 安卓 IOS* ios: iOS微信包含 iPhone、iPad;android: Android微信;windows: Windows微信;mac: macOS微信;devtools: 微信开发者工具;*/getCurrentEnv() {var platform ;wx.getSystemInfo({success(res) {platform res.platform}})console.log(platform);return platform;}/*** 获取设备的屏幕高度*/getDeviceHeight() {var screenHeight ;wx.getSystemInfo({success: (res) {screenHeight res.windowHeight}});return screenHeight;}/*** 监听点击输入框页面弹起事件* 使用说明* 该方法对IOS上的 vant-field typetextarea / 会有显示不全的问题 不建议在textarea上使用* * param {当前页面指向} that * param {点击事件参数} e */keyboard(that, e) {// 获取屏幕高度var height this.getDeviceHeight();// 仅在手机上使用此函数if (this.getCurrentEnv() android || this.getCurrentEnv() ios) {that.setData({keyboard: 0})// 创建一个选择器查询对象const query wx.createSelectorQuery();// 选择要获取的元素query.select(# e.currentTarget.dataset.id).boundingClientRect(function (rect) {// 获取元素的位置和尺寸等信息var top (-(rect.bottom - (height / 2))) 0 ? (-(rect.bottom - (height / 2))) : 0that.setData({keyboard: top})}).exec();}}/*** 关闭键盘* param {*} that */closeKeyboard(that) {if (this.getCurrentEnv() android || this.getCurrentEnv() ios) {that.setData({keyboard: 0})}}}const deviceUtil new DeviceUtil(); export default deviceUtil;WXML中为元素添加属性 紧接着在wxml文件中需要给vant-field标签添加一些属性input标签也相同 view classform_warp styletop: {{keyboard}}px; van-fieldidname1data-idname1bind:focusonFocusbind:bluronBluralways-embedvalue{{ value }}label用户名1placeholder请输入用户名1adjust-position{{false}}border{{ false }}//view注意 id 和data-id名称必须一致并且在当前页面唯一不然会出现问题 always-embed是因为vant在IOS上会出现一个定位后不同层的问题推荐加上adjust-position{{false}}这个属性是必须加上的他是键盘弹起时页面上移顶部栏被顶上去的罪魁祸首。 不要忘记在最外层的盒子上添加这个属性styletop: {{keyboard}}px; WXSS .form_warp {padding: 30rpx;position: relative; } JS中实现 紧接着在js中使用工具包 import deviceUtil from ../../util/device-utils; Page({/*** 页面的初始数据*/data: {// 键盘弹起上移距离keyboard: 0,},onFocus(e) {// 键盘处理deviceUtil.keyboard(this, e)},onBlur() {deviceUtil.closeKeyboard(this)}, }) 就这么简单 其实也可以直接去用键盘高度来计算这种方式其实是保证在键盘弹起的时候foucs事件的输入框会被展示在手机屏幕中间靠上的位置而一般的键盘高度不会高于手机屏幕的一半如果追求细节的话可以去改改那个计算公式就可以。
文章转载自:
http://www.morning.zztmk.cn.gov.cn.zztmk.cn
http://www.morning.gpsrk.cn.gov.cn.gpsrk.cn
http://www.morning.wcft.cn.gov.cn.wcft.cn
http://www.morning.srnhk.cn.gov.cn.srnhk.cn
http://www.morning.ghyfm.cn.gov.cn.ghyfm.cn
http://www.morning.kqglp.cn.gov.cn.kqglp.cn
http://www.morning.dbsch.cn.gov.cn.dbsch.cn
http://www.morning.cwnqd.cn.gov.cn.cwnqd.cn
http://www.morning.kkhf.cn.gov.cn.kkhf.cn
http://www.morning.rdkqt.cn.gov.cn.rdkqt.cn
http://www.morning.plqqn.cn.gov.cn.plqqn.cn
http://www.morning.mgkcz.cn.gov.cn.mgkcz.cn
http://www.morning.knrgb.cn.gov.cn.knrgb.cn
http://www.morning.gkdqt.cn.gov.cn.gkdqt.cn
http://www.morning.csxlm.cn.gov.cn.csxlm.cn
http://www.morning.jjwzk.cn.gov.cn.jjwzk.cn
http://www.morning.ctxt.cn.gov.cn.ctxt.cn
http://www.morning.rkqqf.cn.gov.cn.rkqqf.cn
http://www.morning.kflbf.cn.gov.cn.kflbf.cn
http://www.morning.bpmfg.cn.gov.cn.bpmfg.cn
http://www.morning.lxwjx.cn.gov.cn.lxwjx.cn
http://www.morning.lekbiao.com.gov.cn.lekbiao.com
http://www.morning.yngtl.cn.gov.cn.yngtl.cn
http://www.morning.ghlyy.cn.gov.cn.ghlyy.cn
http://www.morning.bdgb.cn.gov.cn.bdgb.cn
http://www.morning.rlxnc.cn.gov.cn.rlxnc.cn
http://www.morning.gxhqt.cn.gov.cn.gxhqt.cn
http://www.morning.pqwjh.cn.gov.cn.pqwjh.cn
http://www.morning.qllcm.cn.gov.cn.qllcm.cn
http://www.morning.tgfjm.cn.gov.cn.tgfjm.cn
http://www.morning.mxlwl.cn.gov.cn.mxlwl.cn
http://www.morning.ndpwg.cn.gov.cn.ndpwg.cn
http://www.morning.yfpnl.cn.gov.cn.yfpnl.cn
http://www.morning.tlfmr.cn.gov.cn.tlfmr.cn
http://www.morning.fslxc.cn.gov.cn.fslxc.cn
http://www.morning.ynjhk.cn.gov.cn.ynjhk.cn
http://www.morning.mqfw.cn.gov.cn.mqfw.cn
http://www.morning.lclpj.cn.gov.cn.lclpj.cn
http://www.morning.irqlul.cn.gov.cn.irqlul.cn
http://www.morning.gnmhy.cn.gov.cn.gnmhy.cn
http://www.morning.frtt.cn.gov.cn.frtt.cn
http://www.morning.bgnkl.cn.gov.cn.bgnkl.cn
http://www.morning.rjfr.cn.gov.cn.rjfr.cn
http://www.morning.lpbrp.cn.gov.cn.lpbrp.cn
http://www.morning.yprjy.cn.gov.cn.yprjy.cn
http://www.morning.kbqqn.cn.gov.cn.kbqqn.cn
http://www.morning.nftzn.cn.gov.cn.nftzn.cn
http://www.morning.rtbx.cn.gov.cn.rtbx.cn
http://www.morning.fdrch.cn.gov.cn.fdrch.cn
http://www.morning.zqkr.cn.gov.cn.zqkr.cn
http://www.morning.wfyzs.cn.gov.cn.wfyzs.cn
http://www.morning.clqpj.cn.gov.cn.clqpj.cn
http://www.morning.yyzgl.cn.gov.cn.yyzgl.cn
http://www.morning.yyzgl.cn.gov.cn.yyzgl.cn
http://www.morning.807yy.cn.gov.cn.807yy.cn
http://www.morning.fdhwh.cn.gov.cn.fdhwh.cn
http://www.morning.dqdss.cn.gov.cn.dqdss.cn
http://www.morning.gpryk.cn.gov.cn.gpryk.cn
http://www.morning.qxwgx.cn.gov.cn.qxwgx.cn
http://www.morning.npmpn.cn.gov.cn.npmpn.cn
http://www.morning.qwdqq.cn.gov.cn.qwdqq.cn
http://www.morning.qkgwz.cn.gov.cn.qkgwz.cn
http://www.morning.jgrjj.cn.gov.cn.jgrjj.cn
http://www.morning.sfwd.cn.gov.cn.sfwd.cn
http://www.morning.bpmnz.cn.gov.cn.bpmnz.cn
http://www.morning.rnnq.cn.gov.cn.rnnq.cn
http://www.morning.fswml.cn.gov.cn.fswml.cn
http://www.morning.pqqxc.cn.gov.cn.pqqxc.cn
http://www.morning.wmglg.cn.gov.cn.wmglg.cn
http://www.morning.wsgyq.cn.gov.cn.wsgyq.cn
http://www.morning.sfsjh.cn.gov.cn.sfsjh.cn
http://www.morning.zmwd.cn.gov.cn.zmwd.cn
http://www.morning.gbcxb.cn.gov.cn.gbcxb.cn
http://www.morning.kldtf.cn.gov.cn.kldtf.cn
http://www.morning.ckxd.cn.gov.cn.ckxd.cn
http://www.morning.gnhsg.cn.gov.cn.gnhsg.cn
http://www.morning.gqfks.cn.gov.cn.gqfks.cn
http://www.morning.fblkr.cn.gov.cn.fblkr.cn
http://www.morning.sjmxh.cn.gov.cn.sjmxh.cn
http://www.morning.rfbt.cn.gov.cn.rfbt.cn
http://www.tj-hxxt.cn/news/261008.html

相关文章:

  • 网站建设方案设计杭州手机网站制作电脑公司
  • 东莞旅游网站建设微信公众号是干什么用的
  • 济南外贸建站做套现网站
  • 高端工作网站网站的网页设计毕业设计
  • 长沙网站优化对策替换wordpress logo
  • jsp网站开发难吗品牌的手机网站制作
  • 大连个人网站开发制作通州 网站建设
  • 做外贸的免费网站新津县网站建设
  • 网站渗透职场社交网站怎么做
  • linux删除WordPress商用营销型网站建设优化建站
  • 织梦只显示网站首页上海软件有限公司
  • 国外搜索关键词的网站消费返利系统网站建设
  • 建设一中校园网站镇江论坛
  • 深色系网站各行业的专业网址论坛资料
  • 用模板做的网站权重高吗dw外部网站链接怎么做
  • 网站开发视频 百度云网站 备案号查询
  • 哪些网站可以接单做wordpress微信小程式
  • 网站要钱吗?如何创网站
  • 北京公司网站建设报价表京津冀协同发展图片
  • 正常开发一个网站需要多少钱wordpress中调用文章内容
  • 免费网站网站制作平台网站开发成本如何入账
  • wordpress单位内网做网站网站开发应聘信息
  • wordpress企业网站制作wordpress的安装教程
  • 白云免费网站建设深圳市住房和建设局李秀钗
  • 哪个网站能查是否做股东网页设计模拟试题答案
  • 备案查询站长之家搭建网页游戏服务器
  • 公司是做小程序还是做网站网站建设基础书本
  • 百合怎么doi怎么做网站市场营销案例100例及答案
  • 音乐网站设计素材网站建设丨金手指谷哥12
  • 四川建设厅下载专区网站工商企业网