This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* [parseURI 解析URI的内容,返回键值对的对象] | |
* @param {[string]} uri [要解析的URI值] | |
* @return {[obj]} [URI的键值对的对象] | |
* @author 水中月明(shuizhongyueming@gmail.com) | |
*/ | |
function parseURI(uri){ | |
var uri = uri || window.location.search; // 默认使用当前页面的uri值 | |
try{ | |
uri = uri.replace("?",""); // 去除? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @name [getElementsByClassName] | |
* @overview [根据元素clsssName得到元素集合] | |
* @param {[string]} fatherId [父元素的ID,默认为document] | |
* @param {[string]} tagName [子元素的标签名] | |
* @param {[string]} className [用空格分开的className字符串] | |
* | |
* @author unknown | |
*/ | |
function getElementsByClassName(fatherId,tagName,className){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @name[CloudTag] | |
* @overview [一个UI组件,用于制作云标签, | |
* 依赖jQuery 做的很简单,只能简单的从下往上滚动,没有做到那种球状的旋转] | |
* @param {[Array]} arr [存放云标签内容的数组] | |
* @param {[Array]} fontSizeArr [存放文本大小可以随机的值] | |
* @param {[Array]} colorArr [存放文本颜色可以随机的值] | |
* @param {[Object]} option [传入相关参数] | |
* @param {[string]} option.cont [存放云标签的容器 query string] | |
* @param {[string]} option.tagConts [单个标签的各自的直接父元素 query string] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @name [getRealStyle] | |
* @overview [获取元素的CSS属性值] | |
* @param {[Object]} obj [要获取CSS属性值的DOM对象或者jQuery对象] | |
* @param {[string]} styleName [属性名] | |
* @return {[string]} [属性值] | |
* @author unknown | |
*/ | |
function getRealStyle(obj,styleName){//访问CSS属性 | |
var realStyle = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* [SlideMarkMark 滑动评分组件,目前仅支持横向] | |
* @require jQuery 1.7+ | |
* @demo http://news.7k7k.com/webgame/astd/ | |
* @param {[Object]} slideRegion [将参数打包成对象传入] | |
* @param {[Number]} slideRegion.maxMark [评分的最大值 默认:10] | |
* @param {[Number]} slideRegion.decimalPlace [小数的位数 默认:1] | |
* @param {[Number]} slideRegion.contWidth [滑动区域的宽度 默认:slideRegion.cont.width()] | |
* @param {[Number]} slideRegion.shortestLeft [滑块最小偏移值,考虑到滑块的宽度 一般会认为滑动的按钮的中线(非左右两边)到达两端时为滑动的极限 有默认值] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function AddFavorite(sURL, sTitle) { | |
try { | |
window.external.addFavorite(sURL, sTitle); | |
} | |
catch (e) { | |
try { | |
window.sidebar.addPanel(sTitle, sURL, ""); | |
}catch (e) { | |
alert("加入收藏失败,请使用Ctrl+D进行添加"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="zh-CN"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>demo</title> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @name getOuterHtml 获取元素自身以及包含的元素的html | |
* @description 原理是给该元素外面包裹一层div | |
* 获取该div的innerHTML就是要的内容 | |
* 然后再移出包裹的div | |
* @notice 这个方法会移除元素的绑定事件 | |
* @author 水中月明(shuizhongyueming@gmail.com) | |
*/ | |
function getOuterHtml(jqObj){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @name quickSort | |
* @description 针对数组进行快速排序 | |
* @param arr Array 要排序的数组 | |
* @param type String 排序的方式 desc 降序 | |
* @notice 目前只实现了降序排序 | |
* @author 水中月明(shuizhongyueming@gmail.com) | |
*/ | |
function quickSort(arr,type){ | |
var len = arr.length, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @name disorderArr | |
* @description 乱序排列数组 | |
* @param arr Array 要乱序排列的数组 | |
* @return Array 乱序排列后的数组 | |
* @author 水中月明(shuizhongyueming@gmail.com) | |
*/ | |
function disorderArr(arr){ | |
var copyArr = [],len = arr.length,i = 0,disorderedArr = [],randomVal; | |
for(i;i<len;i++){ |
OlderNewer