- 博客(8)
- 收藏
- 关注
转载 Jquery实现对select的操作
select实现对文本框的显示和隐藏/*** 通过select的值实现对文本框的显示和隐藏* #id为一个select控件* .obj为一个文本框*/function initSelector() { if ($('#id').val() != 1) { $('.obj').hide(); }...
2019-08-27 15:13:00 83
转载 图片压缩(1次)
只针对限定1M$data = file_get_contents("输入路径");$maxSize = 1 * 1024 * 1024;//图片进行压缩$data = compressImage($data, $maxSize);file_put_contents("输出路径", $data);function compressImage($data, $...
2019-08-22 15:34:00 93
转载 图片压缩
将图片压缩成jpg或png$type = explode('/', $file->type);$mainType = $type[0];$subType = $type[1];$isImage = $mainType == 'image';$isGif = $subType == 'gif';//gif压缩会变静态的,所以过滤掉if ($isImag...
2019-08-22 11:40:00 69
转载 yii的rules验证规则
public function rules() { return [ [['id'], 'integer'], [['id'], 'required'], [['files'], 'file', 'maxSize' => 50 * 1024 * 1024, 'maxFiles' =...
2019-08-21 10:10:00 84
转载 创建临时文件
$tempFile = tempnam(sys_get_temp_dir(), 'temp');$fhandle = fopen($tempFile, 'w');fwrite($fhandle, $data);//$data为需要写入的数据fclose($fhandle);unlink($tempFile);转载于:https://www.cnblogs...
2019-08-07 15:15:00 80
转载 切换字体的颜色
<!-- index.wxml --><view class="container"> <text class="{{color}}" catchtap="click">点击文字</text></view><!-- index.wxss -->.window-red{ c...
2019-08-05 12:01:00 177
转载 基础
新建项目生命周期//app.jsApp({ onPageNotFount(){ console.log('page not fount');//页面不存在监听函数 }, onError:function(){ console.log('error');//错误监听函数 }, onShow:functio...
2019-08-05 10:22:00 131
转载 算法在计算中的作用
什么是算法就是任何良定义的计算过程,该过程取某个值或者值的集合作为输入并产生某个值或者值的集合作为输出。可以看成是用于求解良说明的计算问题的工具描述一个特定的计算过程来实现该输入/输出关系问题实例由计算该问题解所必需的(满足问题陈述中加强的各种约束的)输入组成 算法好的条件因素将被排序的项数...
2019-08-02 13:13:00 157
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人