Archive for April, 2011

JavaScript: arguments to Array

Thursday, April 28th, 2011

The arguments variable is not a true array, so, to convert it to an array to pass them to another method, here it is.

function hello() {
    var args = Array.prototype.slice.call(arguments);
    myOtherFunction.apply(this,args);

}

jQuery-Mobile: How to delay jQuery Mobile initialization

Wednesday, April 6th, 2011
$(document).bind("mobileinit", function(){
  $.mobile. autoInitialize = false;
});

Then, once your DOM is ready, call

$.mobile.initializePage();

Source: jQuery Mobile Doc

RegEx: Get number and unit from a css property string in JavaScript

Monday, April 4th, 2011
var numeric = "12px".match(/d+/);
var unit = "12px".match(/D+$/);

Source: stackoverflow: convert css units

CSS3: Preserve 3D for iOS, iPhone, iPad hardware acceleration

Monday, April 4th, 2011

To have the iOS WebKit browser accelerate your html element, put the following css property to it

-webkit-transform-style: preserve-3d;

CSS3: Cool glowing form border all in CSS3

Saturday, April 2nd, 2011

Demo: http://kaylarose.github.com/Glowform/

Source: http://github.com/kaylarose/Glowform