![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
功能
佳人与北
每天都要哈哈哈!
展开
-
vue 安卓调用h5方法
async mounted() { //将要给原生调用的方法挂载到 window 上面 let me = this; window['getAppPhone'] = (参数) => { me.getAppPhone(参数); }}methods: { // app端调用此方法,传递手机号 getAppPhone(参数){ …… }}...原创 2021-01-06 14:37:14 · 603 阅读 · 0 评论 -
h5微信分享
1.登录公众号的微信开放平台2.下载.txt文件放到项目域名根目录3.将项目网址域名添加到平台白名单(function() { function shareInit(titleData, shareDescData, shareImgUrl) { var shareUrl = window.location.href; var shareTitleGroup, shareTitle, shareDesc, shareImg; shareTitleGroup = t原创 2020-12-04 10:31:35 · 171 阅读 · 0 评论 -
移动端div跟随滚动条滚动(自制
/*隐藏bady滚动条*/*::-webkit-scrollbar { display: none;}<div class="p2-content search-box"> //内容盒子 有宽有高 y轴滚动 <div class="content-box" id="search-box-content"> //内容部分 <img class="p2-search-input" data-src="img.原创 2020-11-23 16:44:40 · 491 阅读 · 0 评论 -
vue input 金额
<input v-model="price" type="digit" @input="handleInput2" :maxlength="moneyMaxLeng" class="item-asw" placeholder="请输入金额"/> handleInput2(e) { this.$nextTick(() => { let val = e.target.value.toString(); val = val..原创 2020-08-01 19:47:23 · 815 阅读 · 0 评论 -
js请求native的jsBridge
<script type="text/javascript"> // jsbridge init var jsBridge = function (callback) { if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge);...原创 2019-12-27 09:39:12 · 344 阅读 · 0 评论 -
获取两个值中的随机数
如果你想要一个1到10之间的随机数,你可以这样得到它:let randomNumber = randomInt(1, 10);这是randomInt方法的定义:function randomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min;}...原创 2019-12-11 15:25:31 · 329 阅读 · 0 评论 -
h5解决iPhone上input聚焦页面整体上移,键盘消失页面没有落下来
var htmlScrollHeight; $('.other-input input').on('focus', function () { htmlScrollHeight = $(document).scrollTop(); }); $('.other-input input').on('blur', function...原创 2019-12-02 17:29:21 · 1089 阅读 · 0 评论 -
视频播放jsmpeg.js
jsmpeg.js<canvas style="width: 100%" id="video-canvas"></canvas><script src="js/lib/jsmpeg.min.js"></script>app.videoPlay = new JSMpeg.Player(app.params.ts, { c...原创 2019-11-22 12:01:23 · 6438 阅读 · 3 评论 -
url地址后的参数获取
function GetQueryString(name) { var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg);//search,查询?后面的参数,并匹配正则 ...原创 2019-11-15 17:28:19 · 96 阅读 · 0 评论 -
html2canvas.min.js(生成图片插件)
/*! * html2canvas 1.0.0-alpha.12 <https://html2canvas.hertzen.com> * Copyright (c) 2018 Niklas von Hertzen <https://hertzen.com> * Released under MIT License */!function(A,e){"object...原创 2019-07-23 11:14:56 · 10335 阅读 · 0 评论 -
实时获取用户所在城市(管理设备位置信息)
Geolocation模块管理设备位置信息,用于获取地理位置信息,如经度、纬度等。通过plus.geolocation可获取设备位置管理对象。虽然W3C已经提供标准API获取位置信息,但在某些平台存在差异或未实现,为了保持各平台的统一性,定义此规范接口获取位置信息。1、getCurrentPosition: 获取当前设备位置信息2、watchPosition: 监听设备位置变化信息3、clear...转载 2018-04-03 12:09:02 · 2223 阅读 · 0 评论 -
页面根据指定速度滚动到指定位置
$('.p1-s0-to-rule').click('click',function () { var ruleTop = $('.p1-section-rule').position().top;//滚动的位置; $('.p1').animate({ scrollTop: ruleTop},500,'swing');//开始滚动 })animate 该方法通过CSS样式将元素...原创 2018-05-14 16:55:13 · 518 阅读 · 0 评论 -
vue 截图上传头像组件
<template> <div id="demo"> <!-- 遮罩层 --> <div class="container" v-show="panel"> <div> <img id="image"转载 2019-01-22 15:36:17 · 648 阅读 · 0 评论 -
vue 在子组件内获取prop中的值
mounted() { let _this=this; let props = {..._this._props}; console.log(props,"props.......") },参考文章:https://www.cnblogs.com/epines/p/9518745.html原创 2019-01-22 15:47:22 · 9010 阅读 · 0 评论 -
js转义html
/*** @function escapeHTML 转义html脚本 < > & " '* @param a -* 字符串*/escapeHTML: function(a){ a = "" + a; return a.replace(/&/g, "&").replace(/</g, "&...转载 2019-05-23 09:34:34 · 208 阅读 · 0 评论 -
js 关于安卓和苹果及微信内置浏览器的一些bug总结
1.控制软键盘收起:document.activeElement.blur();//软键盘收起2.安卓软键盘弹起与收起的监测var winHeight = $(window).height(); //获取当前页面高度 $(window).resize(function(){ var thisHeight=$(this).height();...原创 2019-04-15 14:46:21 · 753 阅读 · 1 评论 -
手机与座机号码正则表达式/特殊字符
//手机正则 var mobilePtn = /^1[34578][0-9]{9}$/; //座机正则 var landlinePtn = /^(0[0-9]{2,3}\-)([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$/; function isValidMobile(val) { return mobilePtn.test(val);//f...原创 2019-06-20 10:19:13 · 9198 阅读 · 0 评论 -
js 滚动到顶部
//滚动指定div内的滚动条到顶部 $('.returnTop').click(function(){ document.getElementById('container').scrollIntoView({behavior: "smooth"});; });//滚动页面到顶部 $('.returnTop').click(function(){...原创 2019-07-15 16:46:32 · 725 阅读 · 0 评论 -
h5页面流畅滚动
ps:高必须是100%,且内部高比外部高高。html:class="p1scroll scrollable"css:.p1scroll {overflow-y:scroll; -webkit-overflow-scrolling:touch; overflow-scrolling:touch; position:absolute; width:100%;...原创 2019-07-11 17:40:56 · 722 阅读 · 0 评论 -
横屏项目orientation.js
(function() { var wb, hb; function resizeBody() { wb = document.documentElement.clientWidth; hb = document.documentElement.clientHeight; if (hb <= wb) { $('.page,.dialog').c...转载 2019-07-19 14:18:33 · 829 阅读 · 0 评论 -
竖屏项目landscape.js
(function() { var landscapeTip; function createLandscapeTip() { if (!landscapeTip) { landscapeTip = document.createElement('div'); landscapeTip.style.background = 'black'; ...转载 2019-07-19 14:19:13 · 533 阅读 · 0 评论 -
Parallax.js页面视差滚动插件
!function(t, i, e) { "use strict"; function s(t, i) { this.element = t, this.layers = t.getElementsByClassName("layer"); var e = { calibrateX: this.data(t...转载 2019-07-19 14:20:44 · 700 阅读 · 0 评论 -
vconsole.min.js,移动端控制台插件
/*!* vConsole v3.0.0 (https://github.com/Tencent/vConsole)** Tencent is pleased to support the open source community by making vConsole available.* Copyright (C) 2017 THL A29 Limited, a Tencen...转载 2019-07-17 17:38:46 · 5282 阅读 · 0 评论 -
qrcode生成二维码
地址:https://github.com/jeromeetienne/jquery-qrcode<div id="qrcode" class="qrcode"></div>// 生成微信分享二维码 function generateQrcode () { document.getElementById('qrcode').innerHTML = '...原创 2019-07-23 11:08:49 · 191 阅读 · 0 评论 -
js保存图片到手机相册(ios与android通用)
1、将图片上传到后台,拷贝链接。2、Downloader模块管理网络文件下载任务,用于从服务器下载各种文件,并支持跨域访问操作。通过plus.downloader获取下载管理对象。Downloader下载使用HTTP的GET/POST方式请求下载文件,符合标准HTTP/HTTPS传输协议。方法:createDownload: 新建下载任务详情链接:http://www.html5plus.org/...原创 2018-04-03 12:09:24 · 88820 阅读 · 13 评论