原创 數組去重
// 數組去重 uniq: function(array) { var temp = []; //一個新的臨時數組 for (var i = 0; i < array.length; i++) {
原创 小程序改變swiper的指示點的樣式
wxml <view class="wrap"> <swiper class="swipers" autoplay="{{autoplay}}" current="{{currentSwiper}}" bindchange="swi
原创 小程序video
wxml <view class="page-body"> <video id="myVideo" autoplay="true" objectFit="fill" src="http://wxsnsdy.tc.qq.com/10
原创 調用微信sdk
demo地址 只需要更改appid 和祕鑰即可用 頁面後綴都改爲.php 不再是html 頁面開頭需要寫上: <?php require_once "jssdk.php"; $jssdk = new JSSDK("appid", "祕
原创 px轉rem
(function(doc, win) { var docEl = doc.documentElement, resizeEvt = 'orientationchange' in window ? 'orientation
原创 小程序上傳圖片和視頻
<view class="containor"> <view class="publish_text_area"> <!-- 標題 --> <view class="text_area_title">
原创 小程序設置保持圖片原有比例
html頁面 <view wx:for="{{dayItem.images}}"> <image src='{{item}}' data-index="{{ index }}" bindload="imageLoad" s
原创 小程序 滑動切換選項卡
html頁面 <view> <scroll-view scroll-x="true" class="tab-h" scroll-left="{{scrollLeft}}"> <view class="tab-item {{
原创 郵箱驗證
var emailReg = /^\w+@[a-z0-9]+(\.[a-z]+){1,3}$/;
原创 返回上一頁歷史位置
引入jquery.cookie.js 下載鏈接:http://plugins.jquery.com/cookie/ $(function () { var str = window.location.href;
原创 git操作
查看分支:git branch 查看項目更改的代碼:git status 提交所有:git add . 添加描述:git commit -m '描述' 提交:git push 切換到主分支:git checkout master 合併
原创 展開收起文字
function aa(){ $.fn.expandable = function(config) { var that = $(this); var isExpand
原创 jquery 懶加載
var ff=0; var ft=0; var page=1 oAjax() function oAjax(){ $.ajax({ type: 'post',
原创 axios初次使用
config下面的index.js文件: proxyTable: { '/api': { target: 'https://api.lighthousecancertreatment.com/api/v
原创 vue 文字複製粘貼
第一步 npm run dev vue-clipboard2 --save main.js引入 import VueClipboard from 'vue-clipboard2' Vue.use(VueClipboard) <te