- 博客(24)
- 收藏
- 关注
翻译 html 时钟
时钟//开始之前必须懂得时针各指针的弧度计算公式。var canvas,context;function window_onload(){ canvas = document.getElementById("myCanvas"); context = canvas.getContext("2d"); setInterval("draw()",1000);}fun
2017-09-08 15:10:16 602
翻译 html 图片预览
var EventUtil = { addHandler: function(element,type,handler) { if(element.addEventListener) { element.addEventListener(type,handler,false); }else if(element.attachEvent) { element.atta
2017-09-08 15:05:47 501
翻译 伪长连接 简易 聊天
同级目录新建cahe文件夹记得引入jquery这里index.php //长连接---返回中断在连接 function connect(){ $.ajax({ data:{'id':$('#id').val()}, url:'ajaxpush.php', type:'get',
2016-11-16 10:58:43 487
原创 递归菜单 加减号 展开 收回
div{width:300px;margin-top:20px;margin-left:30px;text-align: left;} p{font-size:26px;} a{ text-decoration:none;} img{width:20px;} $(function(){ $('img').click(functi
2016-11-16 10:52:19 601
原创 数据库操作日志并通过日志进行不同数据库的备份
$_POST['_id'] = $s['$id']; //添加返回的id数 $_POST['translate'] = 'insert'; //代表添加操作 $str = json_encode($_POST)."\n";//json数据 $dir = '../ceshi'; //操作日志所在路
2016-10-28 15:54:06 552
原创 php某个时间点的 上个星期几 下个星期几
//$time 已知时间戳 //$week 上一个星期几 //$num 0 本星期 1 上个星期 -1 下个星期 function weekday($time,$week,$num){ if(is_numeric($time)){ $weekday = array('星期日','星期一','星期二','星期三','星期
2016-10-17 10:33:47 491
原创 php打印近似圆
for($y=1;$y $max = $y==1? 28 : round(64/($y*1.5)); if(isset($m)){ $max = $max>=$m[$y-2]?$max-1:$max; if(count($m)==13){
2016-10-14 18:33:29 298
原创 js新闻滚动公告
*{ list-style: none; margin: 0; padding: 0; } li{ height: 25px; line-height: 25px; } #three{ margin: 30px auto; overf
2016-10-12 19:37:56 3212
转载 php图片压缩
//根据类型判断函数 function create($src){ $info=getimagesize($src); switch ($info[2]){ case 1: $im=imagecreatefromgif($src); break; case 2:
2016-10-12 19:36:21 224
翻译 页面无刷新上传文件
-----controllerpublic function actionFileadd(){ $file = $_FILES['photoimg']; $type=substr($file['name'],strrpos($file['name'],'.')+1); $size=$file['size']; $valid
2016-09-05 15:05:16 966
翻译 二维数组根据汉字排序
public function actionArr(){ $arr = array( array('sname'=>',江东2北路店'), array('sname'=>'百宴餐饮---便宜坊烤鸭店'), array('sname'=>'浙江西子宾馆'),
2016-08-18 09:14:18 669
翻译 php将文字转化成mp3文件
autoplay: 唯一可选值为autoplay, 出现autoplay属性并准确赋值时, 音频将会自动播放 controls: 唯一可选值为controls, 出现controls属性并准确赋值时, 音频播放控件将会显示, 控件包括:播放、暂停、定位、音量、全屏
2016-08-10 21:20:28 4241
翻译 原生php验证码
/** * 验证码 * @return [type] [description] */ public function actionCode(){ $session = yii::$app->session; //开启session header("Content-type:image/png");//生成验证码图
2016-08-10 19:48:35 729
原创 php excel导入 导出
//导入excel public function actionExcel(){ $file = fopen('./public/asd.xls','r'); //打开文件 while(($emapData = fgetcsv($file,10000,","))!== FALSE){ //取出每行的值 $a
2016-08-10 10:01:23 277
原创 递归删除文件文件夹方法
/*function rmdirs($dir){ $dir_arr = scandir($dir);//----------------将目录生成数组的形式 foreach($dir_arr as $key=>$val){//---------将数组进行遍历 if($val == '.' || $val == '..'){}
2016-07-20 08:11:13 374
原创 图片放大镜
a{ text-decoration:none;} #table{width: 200px;border: 1px #ececec solid;} .a{padding-left:35px;padding-right:35px;} /*放大后图片的定位 */ #tooltip{position: absolute;} /*局部放大镜盒子的位置 盒子
2016-07-19 20:11:43 252
原创 图片轮播
···css .one{ width: 360px;----外层盒子4倍图片宽度 height:100px;----一样的图片高度 float: left; overflow:hidden; } .two{ margin:0px; paddi
2016-07-19 19:48:52 212
原创 锚点、侧栏滑动出现
header('content-type:text/html;charset=utf8');?> a{ text-decoration:none; color: black; } *{ list-style: none; margin: 0; padding: 0;
2016-07-19 19:46:48 291
原创 php正则与入门正则搭配
if(!empty($_POST)){ if(!empty($_POST['username'])&&!empty($_POST['userpwd'])&&!empty($_POST['usertpwd'])&&!empty($_POST['useremail'])&&!empty($_POST['usercell'])&&!empty($_POS
2016-07-19 19:44:42 309
原创 新手入门正则
Document //公共样式 function $(id){ return document.getElementById(id); } //验证姓名 function user_name(){ var name = $('userna
2016-07-19 19:43:06 202
原创 随机双色球
$(function(){ $(document).ready(function(){ $.ajax({ type:'post', url:'__URL__/red', data:{ num:6
2016-07-19 19:41:40 307
原创 tab标签切换
北京 天津 上海 我爱北京 我爱天津 我爱上海 *{ margin:0px;}li{ list-style-type: none;}.tabtitle ul li{ float:
2016-07-19 19:38:50 211
原创 支付6位密码样式
#pass{ width: 200px; height: 30px; border: 0; font-size: 25px; line-height: 30px; letter-spacing: 8px; background: url(./images/111.png)
2016-07-19 11:30:17 1975
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人