首页
留言板
统计
Search
1
阿里云国际OSS使用CloudFlare免流量
2,512 阅读
2
PP.UA免费域名注册
2,367 阅读
3
Adobe Photoshop CS2经典版 中文原版
2,342 阅读
4
7-Zip中文美化版
2,210 阅读
5
获取免费的 Microsoft 365 E5 开发人员订阅
2,091 阅读
软件分享
网络资源
网络代码
生活情感
免费主机
Search
标签搜索
工具软件
代码
Android
教程
Emlog
办公软件
图形图像
免费空间
Web
情感
PHP
视频
系统工具
Windows
上传下载
建站
PDF
网盘
Typecho
Office
ZJ
累计撰写
812
篇文章
累计收到
109
条评论
首页
栏目
软件分享
网络资源
网络代码
生活情感
免费主机
页面
留言板
统计
搜索到
812
篇与
的结果
2019-11-22
PHP检测网址是否能正常打开代码
这是一个检测网址是否能正常打开的PHP代码,通过下面的代码检测一个网址是否能正常访问,如果正常则会返回http状态码200的值,如果为其它则不正常;这个代码我们可以用到很多地方,例如缓存友情链接的ICO图标时就可以用到,缓存时先检测网站是否正常,如果正常就缓存ICO图标,否则调用一个默认的图标文件。<?php function httpcode($url){ $ch = curl_init(); $timeout = 3; curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch,CURLOPT_URL,$url); curl_exec($ch); return $httpcode = curl_getinfo($ch,CURLINFO_HTTP_CODE); curl_close($ch); }?> 使用方法:<?php echo httpcode('http://123.com');?> 如果显示为200则正常,如果显示其它值表示不正常;$timeout后面的3是设置超时秒数。
2019年11月22日
286 阅读
0 评论
0 点赞
2019-11-22
用JS代码适配电脑端和手机端播放器代码
随着html5的崛起,很多网站都采用html5代码来设计,让网站美观大气,但是html5代码只有支持html5的浏览器才能显示,现在还有很大一部分人用的还是老旧的IE浏览器,尤其是一切企业客户,他们的网站还必须要兼容老版的IE浏览器;就拿播放器来说,互联网上有很多好看的html5播放器,在html5浏览器下很好的运行,但是不支持老旧的IE浏览器,遇到这种情况,最好的办法就是电脑端就用flash播放器来代替,手机端就用原生html5音乐视频标签来播放,省事省力也不用去纠结各个浏览器的显示效果了,下面就是一段JS代码来适配电脑端和手机端采用不同播放器。 在</head>之前添加以下代码:<script src="http://apps.bdimg.com/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $(".playbox").each(function() { var playsrc = $(this).attr('data-u'); var playwidth = $(this).attr('data-w'); var playheight = $(this).attr('data-h'); if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iOS|iPad|Backerry|WebOS|Symbian|Windows Phone|Phone)/i))) { $(this).html('<video '+playwidth+'" '+playheight+'" src="'+playsrc+'" controls></video>'); }else{ $(this).html('<embed wmode="transparent" '+playwidth+'" '+playheight+'" src="http://lanyes.org/demo/Lyplayer.swf?path='+playsrc+'&type=flv&fullscreen=true&autoplay=false&backcolor=99ff33&frontcolor=ffffff" type="application/x-shockwave-flash" quality="high" allowfullscreen="true">'); } }) }) </script>在内容里添加下面代码,data-u为音乐视频地址,data-w为播放器宽度,data-h为播放器高度。<div class="playbox" data-u="音乐或视频地址" data-w="宽度" data-h="高度"></div>
2019年11月22日
325 阅读
0 评论
0 点赞
2019-11-22
旋转的星空特效代码
html5特效代码旋转的星空,首先要设置背景为暗一点的背景色或者图片,例如设置成黑色的背景颜色,然后把代码复制到html文件里,设置下下方JS里的一些设置,如星星的数量、星星移动的范围、星星的大小等,保存后用支持html5的浏览器打开就能看到旋转的星空特效。 <!doctype html> <html> <head> <meta charset="utf-8"> <title>旋转的星空</title> <style type="text/css"> body{background: black;padding: 0;margin: 0; overflow:hidden} .header{margin: 0 auto;width: 100%;height: 100%;background-color: #000;position: relative;} </style> </head> <body> <div class="header"><canvas id="canvas"></canvas></div> <script> var canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width = window.innerWidth, h = canvas.height = window.innerHeight, hue = 217, stars = [], count = 0, maxStars = 3000;//星星数量 var canvas2 = document.createElement('canvas'), ctx2 = canvas2.getContext('2d'); canvas2.width = 100; canvas2.height = 100; var half = canvas2.width / 2, gradient2 = ctx2.createRadialGradient(half, half, 0, half, half, half); gradient2.addColorStop(0.025, '#CCC'); gradient2.addColorStop(0.1, 'hsl(' + hue + ', 61%, 33%)'); gradient2.addColorStop(0.25, 'hsl(' + hue + ', 64%, 6%)'); gradient2.addColorStop(1, 'transparent'); ctx2.fillStyle = gradient2; ctx2.beginPath(); ctx2.arc(half, half, half, 0, Math.PI * 2); ctx2.fill(); // End cache function random(min, max) { if (arguments.length < 2) { max = min; min = 0; } if (min > max) { var hold = max; max = min; min = hold; } return Math.floor(Math.random() * (max - min + 1)) + min; } function maxOrbit(x, y) { var max = Math.max(x, y), diameter = Math.round(Math.sqrt(max * max + max * max)); return diameter / 2; //星星移动范围,值越大范围越小, } var Star = function() { this.orbitRadius = random(maxOrbit(w, h)); this.radius = random(60, this.orbitRadius) / 8; //星星大小 this.orbitX = w / 2; this.orbitY = h / 2; this.timePassed = random(0, maxStars); this.speed = random(this.orbitRadius) / 50000; //星星移动速度 this.alpha = random(2, 10) / 10; count++; stars[count] = this; } Star.prototype.draw = function() { var x = Math.sin(this.timePassed) * this.orbitRadius + this.orbitX, y = Math.cos(this.timePassed) * this.orbitRadius + this.orbitY, twinkle = random(10); if (twinkle === 1 && this.alpha > 0) { this.alpha -= 0.05; } else if (twinkle === 2 && this.alpha < 1) { this.alpha += 0.05; } ctx.globalAlpha = this.alpha; ctx.drawImage(canvas2, x - this.radius / 2, y - this.radius / 2, this.radius, this.radius); this.timePassed += this.speed; } for (var i = 0; i < maxStars; i++) { new Star(); } function animation() { ctx.globalCompositeOperation = 'source-over'; ctx.globalAlpha = 0.5; //尾巴 ctx.fillStyle = 'hsla(' + hue + ', 64%, 6%, 2)'; ctx.fillRect(0, 0, w, h) ctx.globalCompositeOperation = 'lighter'; for (var i = 1, l = stars.length; i < l; i++) { stars[i].draw(); }; window.requestAnimationFrame(animation); } animation(); </script> </body> </html>
2019年11月22日
396 阅读
0 评论
0 点赞
2019-11-22
个性化jquery代码让你的标题栏滚动起来
现在的浏览器都采用的多标签模式,如果网站的标题很长很长,在浏览器标签栏是看不全的,为了更个性化,我们可以使用下面这段个性化jquery代码让你的网站标题栏滚动起来,让用户更容易记住你的网站名称; 如果你想使用个性化jquery代码让你的标题栏滚动起来,把下方的jquery代码复制到你网站的js文件里,就能使用了;要注意这是jquery代码,需要引用jquery库才能正常运行。$(function(){ var titlename= $(document).attr("title").split(""); function gdtitle(){ titlename.push(titlename[0]); titlename.shift(); document.title = titlename.join(""); } setInterval(gdtitle,1000);//设置时间间隔运行 )};
2019年11月22日
345 阅读
0 评论
0 点赞
2019-11-22
JS实时时间特效代码
这是一段JS代码写的实时时间特效代码,站长可以拿来放在网站侧边栏,美化网站的同时也能提高些用户体验度; 下载压缩包把压缩包里的images素材目录上传到网站里,用代码编辑器打开index.php文件,找到标记代码开始处与代码结束中间的就是JS实时时间特效代码,把这段JS代码中的素材路径修改好,就可以放到需要的地方了。 <!---JS实时时间代码开始--> <div id="time"></div> <script> window.onload=function(){getTime();} function getTime(){ var date = new Date(); var hours =formatTime(date.getHours()); var minutes = formatTime(date.getMinutes()); var seconds = formatTime(date.getSeconds()); var $time = document.getElementById('time'); $time.innerHTML=hours +"<img src='images/hm.png' style='margin:0 10px;' width='12' height='40'/>"+ minutes+"<img style='margin:0 10px;' src='images/ms.png' width='12' height='40'/>"+ seconds; setTimeout("getTime()",500);} function formatTime(i){ if(i<10&&i==1){ i= "<img src='images/0.png' width='40' height='60'/>"+"<img src='images/1.png' width='20' height='60'/>"; }else if(i<10&&i!=1){ i= "<img src='images/0.png' width='40' height='60'/>" + "<img src='images/"+i+".png' width='40' height='60'/>"; }else{ var j= i.toString().charAt(0); var z =i.toString().charAt(1); if(j<10 && z<10&&j!=1&&z!=1){ i = "<img src='images/"+j+".png' width='40' height='60'/>" + "<img src='images/"+z+".png' width='40' height='60'/>"; }else if(j<10 && z<10&&j==1&&z!=1){ i = "<img src='images/1.png' width='20' height='60'/>" + "<img src='images/"+z+".png' width='40' height='60'/>"; }else if(j<10 && z<10&&z==1&&j!=1){ i = "<img src='images/"+j+".png' width='40' height='60'/>"+"<img src='images/1.png' width='20' height='60'/>"; }else if(j<10 && z<10&&(j==1&&z==1)){ i="<img src='images/1.png' width='20' height='60'/>"+"<img src='images/1.png' width='20' height='60'/>"; } } return i; } </script> <!--JS实时时间代码结束-->下载地址 蓝奏网盘
2019年11月22日
329 阅读
0 评论
0 点赞
2019-11-22
雪花特效代码分享
该给你的网站也装点下喜庆的味道,分享一个雪花特效代码。 在需要增加雪花代码的页面里加上下方代码即可,如果页面里已经加载了jquery库,那么第一行就不需要。 <script type="text/javascript" src="http://cdn.staticfile.org/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript" src="Snow.js"></script> <link rel="stylesheet" type="text/css" href="Snow.css"> 下载地址 蓝奏网盘
2019年11月22日
353 阅读
0 评论
0 点赞
2019-11-22
PHP检测网址是否能正常打开代码
这是一个检测网址是否能正常打开的PHP代码,通过下面的代码检测一个网址是否能正常访问,如果正常则会返回http状态码200的值,如果为其它则不正常;这个代码我们可以用到很多地方,例如缓存友情链接的ICO图标时就可以用到,缓存时先检测网站是否正常,如果正常就缓存ICO图标,否则调用一个默认的图标文件。<?php function httpcode($url){ $ch = curl_init(); $timeout = 3; curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch,CURLOPT_URL,$url); curl_exec($ch); return $httpcode = curl_getinfo($ch,CURLINFO_HTTP_CODE); curl_close($ch); }?> 使用方法: <?php echo httpcode('http://lanyes.org');?> 如果显示为200则正常,如果显示其它值表示不正常;$timeout后面的3是设置超时秒数。
2019年11月22日
332 阅读
0 评论
0 点赞
2019-11-21
Baklib一个免费搭建博客/文档/手册平台
挺不错的一个平台!有点当年”智能建站”的味道!适合小白用户建站,建博等!尊敬的⽤户,感谢你使⽤baklib。baklib正处于上线测试阶段,特邀您体验, 同时在2019年12⽉30号前注册的⽤户,将终身免费享有“企业版”使⽤权限。官网地址https://www.baklib.com/ 免费功能个人版永久免费流畅的在线文档工具,满足个人用户的撰写、托管和分享。 20 GB 云端存储空间 送二级域名 支持SSL(今天10月30日刚支持的) CDN加速(目前是七牛加速) 多主题展示模板 多端适配(手机电脑) 展示界面颜色配置 在线文本编辑 站点导入私人网站 演示站点https://happy.baklib.com/
2019年11月21日
386 阅读
0 评论
0 点赞
1
...
94
95
96
...
102