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
var array = ["one", "two", "three", "four", "five"]; | |
document.writeln(array + "<br />"); | |
var newArray = shuffle(array); | |
document.writeln(newArray); | |
function shuffle (arr) { | |
var copy = arr.concat(), |
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
sample gist |
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> | |
<head> | |
<title>jQuery Templating Demo</title> | |
<style type="text/css"> | |
html { | |
background:#f3f3f3; | |
font: 13px/1.5 helvetica, arial, san-serif; | |
} | |
ul { |
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 ($) { | |
$.fn.chromeFade = function (opts) { | |
var defs = { msTilFade : 2000, fadeSpeed : 500, fadeTo : 0.01 }, | |
sets = $.extend({}, defs, opts), | |
elems = this, | |
fadeFunc = function () { | |
elems.fadeTo(sets.fadeSpeed, sets.fadeTo); | |
}, | |
fadeTimer = setTimeout(fadeFunc, sets.msTilFade); | |
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> | |
<head> | |
<title>Page Title some change </title> | |
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css" /> | |
<script src="http://code.jquery.com/jquery-1.4.3.min.js"></script> | |
<script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js"></script> | |
</head> | |
<body> |
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
var myObj = (function () { | |
var data = { | |
products : ["foobar", "bazquirk", "gizmo"], | |
services : ["widgets", "other", "last"] | |
}; | |
return { | |
__noSuchMethod__ : function (id, args) { | |
if (id === 'all_products') return data.products; | |
if (id === 'all_services') return data.services; |
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
clear(); | |
var feeds = Array.prototype.slice.call(document.querySelectorAll("div.name a")), | |
i = 0, p, f, doc = ""; | |
while (feeds[i]) { | |
f = feeds[i]; | |
feeds[i++] = { | |
htmlUrl : f.href, | |
xmlUrl : f.href + 'rss', | |
title : f.innerHTML, |
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
var tooltip_button = { | |
show : function () { | |
this.panel.show(); | |
}, | |
hide : function () { | |
this.panel.hide(); | |
}, | |
bind_events : function () { | |
var that = this; | |
this.button.bind("mouseover.Tooltip_Button", function () { that.show.call(that); }); |
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
<div id="exercise" class="yui3-g"> | |
<div class="yui3-u-1-2"> | |
<h3>Group A</h3> | |
<ul id="groupA"> | |
<li>Steven Tyler</li> | |
<li>Joe Perry</li> | |
<li>Brad Whitford</li> | |
<li>Tom Hamilton</li> | |
</ul> | |
</div> |
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
$(document).bind("scroll", function (e) { | |
scrolling = true; | |
}); | |
setInterval(function () { | |
if (scrolling) { | |
//console.profile("scroll"); | |
scrolling = false; | |
var temp_top = win.scrollTop(), | |
down = scroll_top - temp_top < 0 ? true : false, |
OlderNewer