• IOS 手机浏览屏底部被挡住的CSS解决代码片断

    发表于 2019-11-30 22:50:06   |   下载附件
    ios padding浏览屏底部遮挡问题解决IOS 样式问题ios 移动样式

    IOS 手机浏览屏底部被挡住的CSS解决代码片断


    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);


  • 读取文件目录下的所有文件名称

    发表于 2019-11-13 10:02:40   |   下载附件
    读取目录下的文件遍历获取文件名称遍历打开文件遍历目录遍历文件
    /**
     * 得到目录下所有文件数组(仅是文件名)
     */
    function foreachDir($path){
        $fileArray = array();
        // 打开文件夹
        if( $handle=opendir($path) ){ 
            while ( false !== ($file = readdir($handle)) ) { 
                // 排除 当前目录  上级目录
                if( $file!="." && $file!='..'){ 
                    // 打开的是目录
                    if(is_dir($path.$file)){ 
                        foreachDir($path.$file);
                    // 打开的是文件
                    }else{
                        $fileArray[] = $file;
                    }
                } 
            } 
            return $fileArray; 
        } 
    }
    // 得到目录下所有文件数组(仅是文件名)
    $fileList = foreachDir('./textbooks');
  • phpQuery中文手册(更新中)

    发表于 2019-11-07 18:18:15   |   下载附件
    phpQueryphp采集php爬虫框架轻量级 PHP 派虫框架
  • validate 简易正则校验插件

    发表于 2019-10-16 19:36:44   |   下载附件
    validate正则校验表单校验表单提交校验rules 校验正则
    // 添加新规则
    validate.setConfig({
    	chinese: /.*[\u0391-\uFFE5].*$/
    })
    
    // 使用说明
    var userRules = {
        'old_password':[
            { rule:'required', message:'请输入旧密码' },
            { rule:'NumberOrEnglish', message:'旧密码必须是字线或数字'},
            { rule:'min:6', message:'旧密码不能低于6位长度' },
            { rule:'max:20', message:'旧密码不能超过20位长度'}
        ],
        'new_password':[
            { rule:'required', message:'请输入新密码' },
            { rule:'NumberOrEnglish', message:'新密码必须是字线或数字'},
            { rule:'min:6', message:'新密码不能低于6位长度' },
            { rule:'max:20', message:'新密码不能超过20位长度'}
        ],
    }
    
    // 所有校验不通过的错误
    var resultError = validate.test({old_password:'',new_password:''},userRules);
  • 在小程序中使用全局数据监听

    发表于 2019-09-25 09:37:09   |   下载附件
    小程序全局监听definePropertyObject.definePropertygetset
    // 全局可被监听数据
    watchData : {},
    
    // 对监听的属性进行操作,当值发现变更时
    watch: function (Name, method) {
        var obj = this.watchData;
        Object.defineProperty(obj, Name, {
            configurable: true, // 描述属性是否配置,以及可否删除
            enumerable: true,   // 描述属性是否会出现在for in 或者 Object.keys()的遍历中
            set: function (value) {
                this['__' + Name] = value;
                method(value);
            },
            get: function () {
                // 可以在这里打印一些东西,然后在其他界面调用getApp().GD.name的时候,这里就会执行。
                return this['__' + Name]
            }
        })
    },
  • Array.prototype.indexOf

    发表于 2019-09-17 17:51:24   |   下载附件
    Array.prototype.indexOf数组方法indexOf
    Array.prototype.indexOf = function(item) {
        for (var i = 0; i < this.length; i++) {
            if (this[i] == item) return i;
        }
        return -1;
    }
  • 一个CSS值转REM的Sublime Text插件

    发表于 2019-08-12 10:34:58   |   下载附件
    CSSREMcss转remcss转rem sublime text 插件
  • SublimeText3追踪函数工具CTags设置及使用

    发表于 2019-08-12 10:08:36   |   下载附件
    ctagssublime text 函数追踪代码追踪功能插件代码调试追踪
  • Sublime Text插件之Css3

    发表于 2019-08-12 09:04:19   |   下载附件
    css3提示插件sublime css提示css3高亮Sublime Text的CSS3插件
    1.Package Controll地址:https://packagecontrol.io/packages/CSS3
    2.Git源代码地址:https://github.com/y0ssar1an/CSS3
  • LESS 自定义 switch 选择器样式

    发表于 2019-08-09 10:42:15   |   下载附件
    lessswitch选择器样式自定义switch样式checkbox伪装switch样式
    /* 
    	switch盒子 
    	使用参数:宽,高,选中颜色值
    	使用实例:.toggle-switch(68px,24px,#0092ff);
    */
    .toggle-switch (@w:68px,@h:24px,@c:#0092ff){
    
    	display: inline-block; position: relative;
    	width: @w; height: @h; border-radius: 5px;
    
    	input[type="checkbox"] {
    		position: absolute;
    		width: 100%;
    		height: 100%;
    		margin: 0px;
    		filter: alpha(opacity=0);
    		opacity: 0;
    	}
    
    	/*默认样式*/
    	.toggle-switch-content {
    		width: 100%; height: 100%; display: table; border: 1px #e6e5ea solid; background: #f5f5f7;
    		border-radius: @h;
    	}
    	.switch-true,
    	.switch-false {
    		width: @h; height: @h; border-radius: @h;
    	}
    	.switch-true {
    		float: right; background: #FFF; box-shadow: 1px 1px 4px 0 rgba(0,0,0,0.3); display: none; 
    	}
    	.switch-false {
    		float: left; background: #FFF; box-shadow: 1px 1px 4px 0 rgba(0,0,0,0.1);
    	}
    
    	/*选中样式*/
    	input[type="checkbox"]:checked + .toggle-switch-content {
    		background: @c; border: 1px @c solid;
    	}
    	input[type="checkbox"]:checked + .toggle-switch-content .switch-true {
    		display: block;
    	}
    	input[type="checkbox"]:checked + .toggle-switch-content .switch-false {
    		display: none;
    	}
    
    }
每页显示10条,当前为第6页,总页数为22页