Add parallax scrolling to a page's background.
Draws a mandelbrot fractal on a canvas.
usage:
mandelbrot(imageData,width)
Thanks to @atk for doing most of the minification work!
Splits numbers with commas to make them more readable. Thanks to @maettig for being awesome
I always found it strange that when you set the font size to 50% in css, letters don't take 50% of the width of the page.
This script makes text behave in that way.
use like this:
getQueryVariable("foo")
To get variables in urls eg:
http://foo.com/index.html?foo=bar
If you want to support arrays, check the version by @atk below:
This function returns an array of the indentation level of each line of a string.
I made this as part of a yaml parser I'm trying to do =D
you use it like this:
getIndent("\t\t\ttext\n\tmore text\nnot indented")
and it returns this:
A clone of the jquery animate function for NEW BROWSERS ONLY!
For now, you need to add a vendor prefix for it to work, but it will work in future browsers just fine.
To use the function, add it as an element prototype and use it just like you would use the jquery animate function:
element.animate(properties,duration,callback)
Also, I am aware that my coding skills suck a bit =)
This code transparently makes nodelists act like arrays!
With it, you can do this:
document.getElementsByTagName('a').forEach(function(a){
a.style.color = '#F00'
})
A perfect replica (hopefully) of the jQuery .css() method
testNode.css("color","blue") //use it with two string arguments!
testNode.css({color:"red"}) //use it with an object!
testNode.css("color") //make it return the value of a property
It's even chainable!
jQuery .html() clone
A (Hopefully) perfect clone of the jQuery .html() method
If it has an argument, it will set the innerhtml of the element to the value of the argument.
If it has no argument, it returns the innerHTML of the element.
It is also chainable! yay!