Html5使用header标签<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8"> <meta name="description" content="……继续阅读 » 水墨上仙 6年前 (2021-03-12) 3500浏览 2887个赞
html5 绘制图片到canvas<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px solid #c3……继续阅读 » 水墨上仙 6年前 (2021-03-12) 3090浏览 479个赞
html5 canvas绘制线条,可以指定开始和结束点<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2268浏览 1498个赞
HTML5使用nav元素范例<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8"> <meta name="description" content="……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1919浏览 1411个赞
html5 把指定的图片绘制到Canvas<!DOCTYPE html><html><body><p>Image to use:</p><img id="scream" src="the_scream.jpg" alt="The ……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1935浏览 739个赞
HTML5 canvas实现多种颜色渐变效果<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px soli……继续阅读 » 水墨上仙 6年前 (2021-03-12) 3513浏览 2930个赞
html5 canvas绘制圆形发散效果的图形<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px sol……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1900浏览 1380个赞
html5 canvas绘制左右渐变效果的图形<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px sol……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2953浏览 2460个赞
html5 canvas绘制镂空字体的文本<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px solid……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1802浏览 1417个赞
html5 指定位置、颜色在canvas上绘制圆形图案<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px……继续阅读 » 水墨上仙 6年前 (2021-03-12) 3026浏览 2331个赞
php文件格式类<? $mime_types = array( 'gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', ……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2487浏览 1024个赞
javascript转换canvas为image// Converts canvas to an imagefunction convertCanvasToImage(canvas) { var image = new Image(); image.src = canvas.toDataURL("image/png"); r……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1827浏览 1357个赞
通过jQuery提交表单并阻止表单的默认提交,通过e.preventDefault();可以阻止表单的默认提交相应,只执行submit里面的代码。<html><head><script type="text/javascript" src="/jquery/jquery.js"&……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1489浏览 1315个赞
JavaScript解决汉诺塔问题<script language="javascript"> var han=function (disc,src,aux,dst){ if(disc>0){ han(disc-1,src,dst,aux); document.writeln("move……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1755浏览 301个赞
基本的HTML5拖拽效果演示代码<!DOCTYPE HTML><html><head><style type="text/css">#div1 {width:350px;height:70px;padding:10px;border:1px solid #aaaaaa;}&l……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2856浏览 207个赞
通过html5 canvas绘制简单的矩形<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px solid……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1861浏览 2756个赞
通过html5的canvas绘制线条<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px solid #d……继续阅读 » 水墨上仙 6年前 (2021-03-12) 3425浏览 2914个赞
通过html5的canvas绘制圆形图案<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px solid ……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1593浏览 1056个赞
HTML5之特效之雨点效果代码<!DOCTYPE HTML> <html><head><script type="text/javascript" src="jquery-1.7.2.min.js"></script><script typ……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1795浏览 2899个赞
django通过ajax发起请求返回JSON格式的数据 这是后台处理的def checkemail(request): user = None if request.POST.has_key('email'): useremail……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1724浏览 2263个赞
javascript table 隔行变色代码function changeTableColor(oddColor,evenColor){ var tables=document.getElementsByTagName('table'); for(var i=0;i<tables.length;i++){ var ……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2274浏览 1429个赞
基本的HTML5视频播放控制代码演示<!DOCTYPE html> <html> <body> <div style="text-align:center"> <button onclick="playPause()">Play/Pause&……继续阅读 » 水墨上仙 6年前 (2021-03-12) 3490浏览 405个赞
javascript通过表格绘制颜色填充矩形<html> <head> <title> Javascript画矩形 </title> <script type="text/javascript"> //定义函数,传入设置参数,返回一个有背景颜色的表……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2757浏览 1704个赞
jquery.validate.js是jquery下的一个验证插件,功能比较强大,早就有所耳闻但是一只没有动手用过,现在在于能够研究一下了。 这里转载一篇前辈写的文章,在我自己的理解上修改了一下,仅作记录。 国内某大公司的代码<script type="text/……继续阅读 » 水墨上仙 6年前 (2021-03-12) 3646浏览 1641个赞
JavaScript将一个整数数组先按照因子数量排序,再按照数字大小排序某笔试中的题,不得不承认这道题是个好题,考察了很多方面。js的数组操作,算法,逻辑能力,还有预防各种坑的能力……一共搞了大概有4小时,函数逐个用firebug测,无法想象在考场上大概不到1小时,还不能调试……能写对的绝对是个神。公司遇到这样的神,就算其他题都不写也应该收了。来源:http……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2014浏览 402个赞
JavaScript中克隆对象function clone(obj) { // Handle the 3 simple types, and null or undefined if (null == obj || "object" != typeof obj) return obj; // Handle D……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2711浏览 2609个赞
JavaScript中检查字符串是否为空的最简单方法if (strValue) { //do something}……继续阅读 » 水墨上仙 6年前 (2021-03-12) 3523浏览 1768个赞
JavaScript对URL进行编码var myUrl = "http://example.com/index.html?param=1&anotherParam=2";var myOtherUrl = "http://example.com/index.html?url=" + encodeURICo……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1606浏览 2019个赞
JavaScript中16进制和10进制的相互转换var sHex=(255).toString(16);//ffvar iNum=parseInt("ff",16);//255……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2708浏览 2745个赞
107个JavaScript基本函数来源:http://blog.csdn.net/liuzx32/article/details/7770243 * 1.document.write(”");为 输出语句 * 2.JS中的注释为// * 3.传统的HTML文档顺序是:document->html->(head……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1965浏览 2191个赞
JavaScript的Base64编码代码片段var Base64 = {// private property_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",// public method for encoding……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2522浏览 2728个赞
JavaScript字符与ASCII码之间的转换console.log("\n".charCodeAt(0));//10console.log(String.fromCharCode(65));//A……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1921浏览 588个赞
自定义JavaScript中的endWith函数String.prototype.endsWith = function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1;}; ……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2911浏览 1386个赞
JavaScript添加和删除Class//Add Classdocument.getElementById("MyElement").className += " MyClass";//Remove Classdocument.getElementById("MyElement").c……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2894浏览 625个赞
javascript快速排序算法代码function qsort(a) { if (a.length == 0) return []; var left = []; var right = []; var pivot = a[0]; for (var i = a.length; --i;) { i……继续阅读 » 水墨上仙 6年前 (2021-03-12) 3004浏览 2707个赞
javascript冒泡法排序算法演示代码<html><head><script type="text/javascript">// GLOBAL FUNCTIONArray.prototype.bubble_sort = function() { var i, j; va……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2637浏览 380个赞
JavaScript中的日期格式化Date.prototype.toString=function(format,loc){ var time={}; time.Year=this.getFullYear(); time.TYear=(""+time.Year).substr(2); time.Mon……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1612浏览 980个赞
这是一个非常简单形象的JS类使用范例,this的作用就是指向调用该方法的对象,比如这个例子,当调用new Person的时候,this就表示he这个对象,调用this.name 就等于 he.name。email前面为什么要使用一个下划线呢?因为js只有公共作用域,没有私用的属性和方法,所以开发者为了做区别,就用一个下划线表示这个属性或者方法是私有的,当然,……继续阅读 » 水墨上仙 6年前 (2021-03-12) 3383浏览 2422个赞
这段代码演示了javascript中如何输入多行字符串var htmlSTring = "<div>\ This is a string.\</div>";……继续阅读 » 水墨上仙 6年前 (2021-03-12) 4600浏览 1070个赞
JS选择textarea内的文本,全选<!------> <script type="text/javascript"> function select_field(id){ document.getElementById(id).focus(); docu……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2826浏览 821个赞
将图片的src设置为blank.gif,真正的图片放到data-src<img src="blank.gif" class="lazy" data-src="/images/full-size.jpg" width="240" height="152&quo……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2439浏览 2764个赞
自定义个JS事件绑定函数,用这个函数绑定事件更方便<script type="text/javascript">/** * Attach an event handler on a given Node taking care of Browsers Differences * @param {Object} no……继续阅读 » 水墨上仙 6年前 (2021-03-12) 3088浏览 1711个赞
这段代码是一个标准的JS版的MD5加密算法var MD5 = function (string) { function RotateLeft(lValue, iShiftBits) { return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits)……继续阅读 » 水墨上仙 6年前 (2021-03-12) 2841浏览 1120个赞
JavaScript判断数组是否包含指定的元素,这段代码通过prototype定义了数组方法,这样就可以在任意数组调用contains方法/** * Array.prototype.[method name] allows you to define/overwrite an objects method * needle is the item ……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1862浏览 687个赞
JavaScript在文本框中默认显示图片背景,获得焦点后消失的代码效果演示:http://css-tricks.com/examples/InputWithBackgroundImage/ html代码<form name="searchform" id……继续阅读 » 水墨上仙 6年前 (2021-03-12) 1924浏览 1187个赞