Html5使用header标签<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8"> <meta name="description" content="……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2297浏览 1614个赞
html5 绘制图片到canvas<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px solid #c3……继续阅读 » 水墨上仙 5年前 (2021-03-12) 1841浏览 1438个赞
html5 canvas绘制线条,可以指定开始和结束点<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2582浏览 607个赞
HTML5使用nav元素范例<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8"> <meta name="description" content="……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3058浏览 1874个赞
html5 把指定的图片绘制到Canvas<!DOCTYPE html><html><body><p>Image to use:</p><img id="scream" src="the_scream.jpg" alt="The ……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2577浏览 2560个赞
HTML5 canvas实现多种颜色渐变效果<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px soli……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3275浏览 1275个赞
html5 canvas绘制圆形发散效果的图形<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px sol……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3224浏览 1458个赞
html5 canvas绘制左右渐变效果的图形<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px sol……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3194浏览 1705个赞
html5 canvas绘制镂空字体的文本<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px solid……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3451浏览 1225个赞
html5 指定位置、颜色在canvas上绘制圆形图案<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3012浏览 697个赞
php文件格式类<? $mime_types = array( 'gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', ……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2606浏览 1448个赞
javascript转换canvas为image// Converts canvas to an imagefunction convertCanvasToImage(canvas) { var image = new Image(); image.src = canvas.toDataURL("image/png"); r……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2102浏览 1155个赞
通过jQuery提交表单并阻止表单的默认提交,通过e.preventDefault();可以阻止表单的默认提交相应,只执行submit里面的代码。<html><head><script type="text/javascript" src="/jquery/jquery.js"&……继续阅读 » 水墨上仙 5年前 (2021-03-12) 1876浏览 2495个赞
JavaScript解决汉诺塔问题<script language="javascript"> var han=function (disc,src,aux,dst){ if(disc>0){ han(disc-1,src,dst,aux); document.writeln("move……继续阅读 » 水墨上仙 5年前 (2021-03-12) 1699浏览 1805个赞
基本的HTML5拖拽效果演示代码<!DOCTYPE HTML><html><head><style type="text/css">#div1 {width:350px;height:70px;padding:10px;border:1px solid #aaaaaa;}&l……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2652浏览 2420个赞
通过html5 canvas绘制简单的矩形<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px solid……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3190浏览 1843个赞
通过html5的canvas绘制线条<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px solid #d……继续阅读 » 水墨上仙 5年前 (2021-03-12) 1535浏览 2891个赞
通过html5的canvas绘制圆形图案<!DOCTYPE html><html><body><canvas id="myCanvas" width="200" height="100" style="border:1px solid ……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2318浏览 157个赞
HTML5之特效之雨点效果代码<!DOCTYPE HTML> <html><head><script type="text/javascript" src="jquery-1.7.2.min.js"></script><script typ……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2164浏览 1929个赞
django通过ajax发起请求返回JSON格式的数据 这是后台处理的def checkemail(request): user = None if request.POST.has_key('email'): useremail……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3174浏览 174个赞
javascript table 隔行变色代码function changeTableColor(oddColor,evenColor){ var tables=document.getElementsByTagName('table'); for(var i=0;i<tables.length;i++){ var ……继续阅读 » 水墨上仙 5年前 (2021-03-12) 1674浏览 480个赞
基本的HTML5视频播放控制代码演示<!DOCTYPE html> <html> <body> <div style="text-align:center"> <button onclick="playPause()">Play/Pause&……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2152浏览 854个赞
javascript通过表格绘制颜色填充矩形<html> <head> <title> Javascript画矩形 </title> <script type="text/javascript"> //定义函数,传入设置参数,返回一个有背景颜色的表……继续阅读 » 水墨上仙 5年前 (2021-03-12) 1584浏览 1368个赞
jquery.validate.js是jquery下的一个验证插件,功能比较强大,早就有所耳闻但是一只没有动手用过,现在在于能够研究一下了。 这里转载一篇前辈写的文章,在我自己的理解上修改了一下,仅作记录。 国内某大公司的代码<script type="text/……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3292浏览 2494个赞
JavaScript将一个整数数组先按照因子数量排序,再按照数字大小排序某笔试中的题,不得不承认这道题是个好题,考察了很多方面。js的数组操作,算法,逻辑能力,还有预防各种坑的能力……一共搞了大概有4小时,函数逐个用firebug测,无法想象在考场上大概不到1小时,还不能调试……能写对的绝对是个神。公司遇到这样的神,就算其他题都不写也应该收了。来源:http……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3458浏览 1655个赞
JavaScript中克隆对象function clone(obj) { // Handle the 3 simple types, and null or undefined if (null == obj || "object" != typeof obj) return obj; // Handle D……继续阅读 » 水墨上仙 5年前 (2021-03-12) 1534浏览 860个赞
JavaScript中检查字符串是否为空的最简单方法if (strValue) { //do something}……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3875浏览 1225个赞
JavaScript对URL进行编码var myUrl = "http://example.com/index.html?param=1&anotherParam=2";var myOtherUrl = "http://example.com/index.html?url=" + encodeURICo……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2435浏览 2835个赞
JavaScript中16进制和10进制的相互转换var sHex=(255).toString(16);//ffvar iNum=parseInt("ff",16);//255……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2130浏览 322个赞
107个JavaScript基本函数来源:http://blog.csdn.net/liuzx32/article/details/7770243 * 1.document.write(”");为 输出语句 * 2.JS中的注释为// * 3.传统的HTML文档顺序是:document->html->(head……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2220浏览 563个赞
JavaScript的Base64编码代码片段var Base64 = {// private property_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",// public method for encoding……继续阅读 » 水墨上仙 5年前 (2021-03-12) 1560浏览 2289个赞
JavaScript字符与ASCII码之间的转换console.log("\n".charCodeAt(0));//10console.log(String.fromCharCode(65));//A……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2241浏览 1365个赞
自定义JavaScript中的endWith函数String.prototype.endsWith = function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1;}; ……继续阅读 » 水墨上仙 5年前 (2021-03-12) 1596浏览 2423个赞
JavaScript添加和删除Class//Add Classdocument.getElementById("MyElement").className += " MyClass";//Remove Classdocument.getElementById("MyElement").c……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2251浏览 1864个赞
javascript快速排序算法代码function qsort(a) { if (a.length == 0) return []; var left = []; var right = []; var pivot = a[0]; for (var i = a.length; --i;) { i……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2192浏览 2941个赞
javascript冒泡法排序算法演示代码<html><head><script type="text/javascript">// GLOBAL FUNCTIONArray.prototype.bubble_sort = function() { var i, j; va……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3323浏览 2752个赞
JavaScript中的日期格式化Date.prototype.toString=function(format,loc){ var time={}; time.Year=this.getFullYear(); time.TYear=(""+time.Year).substr(2); time.Mon……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2475浏览 1583个赞
这是一个非常简单形象的JS类使用范例,this的作用就是指向调用该方法的对象,比如这个例子,当调用new Person的时候,this就表示he这个对象,调用this.name 就等于 he.name。email前面为什么要使用一个下划线呢?因为js只有公共作用域,没有私用的属性和方法,所以开发者为了做区别,就用一个下划线表示这个属性或者方法是私有的,当然,……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2077浏览 2984个赞
这段代码演示了javascript中如何输入多行字符串var htmlSTring = "<div>\ This is a string.\</div>";……继续阅读 » 水墨上仙 5年前 (2021-03-12) 4046浏览 1454个赞
JS选择textarea内的文本,全选<!------> <script type="text/javascript"> function select_field(id){ document.getElementById(id).focus(); docu……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2578浏览 1140个赞
将图片的src设置为blank.gif,真正的图片放到data-src<img src="blank.gif" class="lazy" data-src="/images/full-size.jpg" width="240" height="152&quo……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2931浏览 2932个赞
自定义个JS事件绑定函数,用这个函数绑定事件更方便<script type="text/javascript">/** * Attach an event handler on a given Node taking care of Browsers Differences * @param {Object} no……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3074浏览 2890个赞
这段代码是一个标准的JS版的MD5加密算法var MD5 = function (string) { function RotateLeft(lValue, iShiftBits) { return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits)……继续阅读 » 水墨上仙 5年前 (2021-03-12) 3441浏览 779个赞
JavaScript判断数组是否包含指定的元素,这段代码通过prototype定义了数组方法,这样就可以在任意数组调用contains方法/** * Array.prototype.[method name] allows you to define/overwrite an objects method * needle is the item ……继续阅读 » 水墨上仙 5年前 (2021-03-12) 1966浏览 1425个赞
JavaScript在文本框中默认显示图片背景,获得焦点后消失的代码效果演示:http://css-tricks.com/examples/InputWithBackgroundImage/ html代码<form name="searchform" id……继续阅读 » 水墨上仙 5年前 (2021-03-12) 2791浏览 2927个赞