Skip to content

Instantly share code, notes, and snippets.

@tangyangzhe
tangyangzhe / gist:4276560
Created December 13, 2012 14:01
javascript模块模式实现
// http://dancewithnet.com/2007/12/04/a-javascript-module-pattern/
<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/utilities/utilities.js"></script>
<ul id="myList">
<li class="draggable">一项</li>
<li>二项</li>
<li class="draggable">三项</li>
</ul>
<script>
YAHOO.namespace("myProject");
YAHOO.myProject.myModule = function () {
@tangyangzhe
tangyangzhe / gist:4256645
Created December 11, 2012 07:49
js拖动
window.onload = function () {
drag(document.getElementById('drag'), [200, 400, 30, 300]);
};
function drag(o, r) {
o.firstChild.onmousedown = function () {
return false;
};
o.onmousedown = function (a) {
o.style.cursor = 'move';
@tangyangzhe
tangyangzhe / 12306.user.js
Created December 11, 2012 03:01 — forked from quietlynn/12306.user.js
12306 Auto Query => A javascript snippet to help you book ticket
/*
12306 Auto Query => A javascript snippet to help you book tickets online.
Copyright (C) 2011-2012 Jingqin Lynn
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes Sizzle.js