摘要: var zIndex = 1;window.onload = function (){ var oDrag1 = document.getElementById("drag1"); var oDrag2 = document.getElementById("drag2"); drag(oDrag1); drag(oDrag2);};function drag(oDrag){ var disX = dixY = 0; oDrag.onmousedown = function (event) { var event = event || window.eve 阅读全文
posted @ 2012-03-05 14:46 kyiku 阅读(183) 评论(0) 推荐(0) 编辑
摘要: function parseURL(url) {var a = document.createElement('a');//创建一个链接a.href = url;return {source: url,protocol: a.protocol.replace(':',''),host: a.hostname,port: a.port,query: a.search,params: (function(){var ret = {},seg = a.search.replace(/^\?/,'').split('&&# 阅读全文
posted @ 2012-03-03 08:25 kyiku 阅读(1251) 评论(0) 推荐(0) 编辑
摘要: /** * 替换关键字 * @param {String}stringObj 要操作的字符串 * @param {String}replaceText要替换的字符串 * @param {String}newText 替换成新的字符串 */function replaceKey(stringObj , replaceText , newText) { var regExp = new RegExp(replaceText, "g"); stringObj = stringObj.replace(regExp, newText); return stringObj;} 阅读全文
posted @ 2012-03-01 15:36 kyiku 阅读(646) 评论(1) 推荐(0) 编辑
摘要: function loadScript() { var script = document.createElement("script"); script.type = "text/javascript"; script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=initialize"; document.body.appendChild(script);}window.onload = loadScript; 阅读全文
posted @ 2012-02-29 16:31 kyiku 阅读(882) 评论(0) 推荐(0) 编辑
摘要: -moz-box-shadow: 0 0 4px rgba(80,160,0,.05); 阅读全文
posted @ 2012-02-28 14:37 kyiku 阅读(456) 评论(1) 推荐(0) 编辑
摘要: var HTTP = { //该属性用于缓存XMLHttpRequest对象的数组 _XMLHttpRequestPool : [], //判断对象是否为空 _isEmptyDataObject : function(data) { for ( var name in data) { if (name !== "toJSON") { return false; } } return true; }, _encodeFormData : function(data) { var pairs = []; var regexp = /%20/g; for ( var name i 阅读全文
posted @ 2012-02-23 17:38 kyiku 阅读(263) 评论(0) 推荐(1) 编辑
摘要: <script type="text/javascript"> function max(/* ... */){ var m=Number.NEGATIVE_INFINITY; for(var i =0 ; i< arguments.length ; i++){ if(arguments[i]>m) { m=arguments[i]; } } return m } var l=max(1,20,100,2,3,1000); alert(l);</script> 阅读全文
posted @ 2012-02-19 15:53 kyiku 阅读(132) 评论(0) 推荐(0) 编辑
摘要: <script type="text/javascript">// <![CDATA[/** 智能机浏览器版本信息:**/var browser = { versions: function () { var u = navigator.userAgent, app = navigator.appVersion; return {//移动终端浏览器版本信息 trident: u.indexOf('Trident') > -1, //IE内核 presto: u.indexOf('Presto') > -1, // 阅读全文
posted @ 2012-02-17 11:28 kyiku 阅读(196) 评论(0) 推荐(0) 编辑