Skip to content

Instantly share code, notes, and snippets.

@prgg
prgg / appopen.js
Created April 3, 2014 08:32
appOpen
/*******下载App或者打开APP begin********/
//打开客户端
function _openApp(openAppUrl){
var appIframe = document.createElement("iframe");
appIframe.src = openAppUrl;
appIframe.style.display = "none";
document.body.appendChild(appIframe);
}
//跳转下载页面
@prgg
prgg / moveClear.js
Created January 21, 2014 09:51
滑动解锁
(function(){
//处理对象&初始变量
var float_obj = document.getElementById('float_footer'),
float_cur = document.getElementById('float_footer_cur'),
float_cur_startClass = float_cur.className,
eventOff,eventMaxWidth = 195,startX,clientX;
//按下鼠标&触点
function clearStart(event){
if(/ui-slider-handle/.test(event.target.className)){
@prgg
prgg / isImgs.js
Last active January 3, 2016 05:28
isImgs
document.body.innerHTML = "";
var loading = 0,
images = [
"http://image3.guang.j.cn/images/1671/mid2/1383734759006.jpg",
"http://image2.guang.j.cn/images/269/mid2/19592906963_1197389008.jpg",
"http://image4.guang.j.cn/images/1192/mid2/1383734597731.jpg",
"http://image2.guang.j.cn/images/615/mid2/35063621471_47669400.jpg",
"http://image4.guang.j.cn/images/703/mid2/1383731944116.jpg",
"http://image3.guang.j.cn/images/1754/mid2/1383732208902.jpg",
@prgg
prgg / tabs.html
Created December 20, 2013 04:22
tabs
<!doctype html>
<html>
<head>
<title>Tabs</title>
<script src="http://image.guang.j.cn/images/js/jquery-1.7.1.min.js?v=1385366982"></script>
</head>
<body>
<ul id="标题">
<li>1</li>
@prgg
prgg / createSelect.js
Last active December 31, 2015 03:09
Create Select
$.ajax({
url : "http://www.j.cn/",
success : function(data){
var select = createSelect(data);
select.appendTo("body");
}
});
//[{"val":1,"text":"test"},{"val":2,"text":"test"},{"val":3,"text":"test"}]
function createSelect(data){
var $select = $("<select>"),
@prgg
prgg / placeholder.js
Last active December 30, 2015 21:29
Html5 Placeholder
/*
* 表单项文本框 - 默认文本的交互行为支持
* @param {Object} objs Dom对象,可多个
* @param {Array} colors [默认字体颜色,改变后字体颜色]
*/
function placeholder(objs,colors) {
var supportPlaceholder = 'placeholder' in document.createElement('input'),
$this = $(objs),
relogs = [],
@prgg
prgg / loadImage.js
Created December 9, 2013 08:01
图片预加载 Images Loading
var prgg = {};
//图片预加载
prgg.loadImage = function(url,callback){
if(url.constructor === Array){
var that = this,
urls = url;
url = urls.pop();
if(urls.length < 1){
urls = null;
}
@prgg
prgg / windowsBlueCode.txt
Created December 6, 2013 07:43
windows 蓝屏代码详解
Windows蓝屏错误代码祥解 蓝屏错误代码祥解我们在使用Windows的时候,出现蓝屏是经常的事。大多数时候,我们只能reset,现在公布蓝屏错误代码含义,以备使用。
数值叙述
0 0x0000作业完成
1 0x0001不正确的函数
2 0x0002系统找不到指定的档案
3 0x0003系统找不到指定的路径
4 0x0004系统无法开启档案
5 0x0005拒绝存取
6 0x0006无效的代码
@prgg
prgg / cookie.js
Created December 3, 2013 09:39
cookie
@prgg
prgg / addStyle.js
Last active December 30, 2015 02:59
添加样式 add style
//添加样式文本 - AddToStyleText
function addStyle(cssText){
var style = document.createElement("style");
style.type = "text/css";
try {
style.appendChild(document.createTextNode(cssText));
} catch (ex) {
style.styleSheet.cssText = cssText;
}
var head = document.getElementsByTagName("head")[0];