Skip to content

Instantly share code, notes, and snippets.

@Wilto
Wilto / carousel.js
Created January 8, 2011 21:38
I know I'm reinventing the wheel here, but this is a simple carousel I whipped up for the sake of flexible layouts.
{
"images" : {
"image1" : [
{
"src" : "path/to/img1.png",
"width" : "190px",
"layer" : "3",
"rotation": [
{
"degrees" : -90,
@Wilto
Wilto / swipe.js
Created June 9, 2011 22:37
Modified jQM Swipe Event
// also handles swipeleft, swiperight
$.event.special.swipe = {
setup: function() {
var thisObject = this,
$this = $( thisObject );
$this
.bind( touchStartEvent, function( event ) {
var data = event.originalEvent.touches ?
event.originalEvent.touches[ 0 ] :
/*/
alert("Commented out.");
//*/
//*/
alert("Runs normally.");
@Wilto
Wilto / details-toggle-support.js
Created June 18, 2011 19:48
Test/polyfill for native “details”/“summary” support.
/* TODO: Something about keyboard support. */
(function(win, undefined){
support = {
detailToggle : function() {
var fakeBody,
doc = document,
de = doc.documentElement,
bod = doc.body || (function() {
fakeBody = true;
@Wilto
Wilto / gist:1107253
Created July 26, 2011 17:12
Example Fade-y Slideshow Thing
.faderotate {
height: 250px;
position: relative;
width: 100%;
}
.faderotate .slide {
left: 0;
position: absolute;
top: 0;
@Wilto
Wilto / test.js
Created December 13, 2011 17:03
Scott Jehl/Kangax’s fixed positioning test
$.support.positionFixed = (function (){
var contain = $( document.documentElement );
if ( 'getBoundingClientRect' in contain[0] ) {
var el = $( "<div style='position:fixed;top:100px;'>x</div>" ).appendTo( contain ),
originalHeight = contain[ 0 ].style.height,
w = window,
result;
contain.height( screen.height * 2 + "px" );
var vendors = [ "Webkit", "Moz", "O" ];
function validStyle( prop, value, check_vend ) {
var div = document.createElement('div'),
uc = function( txt ) {
return txt.charAt( 0 ).toUpperCase() + txt.substr( 1 )
},
vend_pref = function( vend ) {
return "-" + vend.charAt( 0 ).toLowerCase() + vend.substr( 1 ) + "-";
},
(function($) {
$.fn.accessibleTabs = function(){
return this.each(function(e) {
var $el = $(this);
$el.find("li").keydown(function(e) {
var $el = $(this),
$prevTab = $el.prev().find('a'),
$nextTab = $el.next().find('a'),
$first = $el.parent().find("li:first a"),
$(function($){
var depjson,
builderhtml = [],
sortable = [],
groupBy = function( jsondata ) {
var newarray = [];
for (key in jsondata) {
console.log( key );
}