This file contains hidden or 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
var pullrefresh = { | |
/*++++++++++++++ 初始化 +++++++++++++*/ | |
init: function (data) { | |
var self = this; | |
this.generatedCount = 0; | |
document.addEventListener('DOMContentLoaded', function () { | |
setTimeout(function () { |
This file contains hidden or 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 upDownShow (currObj,showObj) { | |
var top = currObj.offset().top, | |
height = showObj.height(), | |
curHeight =currObj.height(); | |
winTop = $(window).scrollTop(); | |
if(top-winTop < height) { | |
showObj.css({"top":curHeight}).show(); | |
} else { | |
showObj.css({"top":-height}) | |
} |
This file contains hidden or 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
/* | |
test 检查指定的字符串是否存在 | |
exec 返回查询值 | |
match 得到查询数组 | |
search 返回搜索位置 | |
replace 替换字符 利用正则替换 | |
split 利用正则分割数组 | |
*/ | |
var str = "Str", | |
num = 1123, |
This file contains hidden or 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> | |
<head> | |
<!-- Run in full-screen mode. --> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<!-- Make the status bar black with white text. --> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black"> |
This file contains hidden or 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
/* | |
* From css-tricks.com | |
* http://css-tricks.com/snippets/css/media-queries-for-standard-devices/ | |
*/ | |
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ |
This file contains hidden or 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
/* | |
* Author: http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/ | |
*/ | |
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ | |
} |
This file contains hidden or 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
/* | |
test 检查指定的字符串是否存在 | |
exec 返回查询值 | |
match 得到查询数组 | |
search 返回搜索位置 | |
replace 替换字符 利用正则替换 | |
split 利用正则分割数组 | |
*/ | |
var str = "Str", | |
num = 1123, |
This file contains hidden or 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="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style type="text/css"> | |
body{ | |
font-size:12px; | |
} | |
.hover{ |
This file contains hidden or 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
var processor = { | |
timeoutId : null, | |
performProcessing : function () { | |
}, | |
process: function () { | |
clearTimeout(this.timeoutId); | |
var that = this; | |
this.timeoutId = setTimeout(function () { | |
that.performProcessing(); | |
},100) |
This file contains hidden or 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
//array chunking | |
function chunk (array,process,context) { | |
setTimeout(function () { | |
//取出数组每一项 | |
var item = array.shift(); | |
//处理函数 | |
process.call(context,item); | |
//只要不为空 | |
if(array.length > 0) { | |
setTimeout(arguments.callee,100); |