Skip to content
Wolfy87 edited this page Feb 16, 2011 · 54 revisions

Welcome!

This wiki will tell you everything you need to know about the Spark JavaScript library. First off it was written by Oliver Caldwell, a 16 year old web developer from England. Work started on Spark on the 22nd of October 2010 because of an idea that came to fruition while on the train home from work.

The majority of this wiki is used for future plans, current capabilities and examples of each function. I hope you like Spark and that it has helped you with your web projects.

Compatability

Spark has been tested and proven to work in

  • Firefox
  • Chrome
  • Safari
  • Opera
  • Internet Explorer 6+

If you ever encounter a problem, please file an issue so I can fix it.

Plugins

You create plugins by assigning functions to the SparkFn object and running the SparkIn function. You can access the returned elements from the Sizzle engine via this.elements. Here is an example plugin:

SparkFn.read = function() {
    alert(this.elements[0].innerHTML);
};
SparkIn();

You run it just like you would any other function, like so.

$('h1').read();

THE DOCUMENTATION HAS MOVED TO HERE

Official Plugins

replace - Allow inputs to have a default value the hides on focus and comes back if the user clicks out without typing.

twitter - Get a users latest tweet from twitter and insert its contents into an element.

transition - Allows showing and hiding of elements in a fancy way.

Functions

content - Manipulate or retrieve the contents of elements.

cookie - Get or set cookies.

event - Runs a specified function when the specified event occurs.

size - Manipulate or retrieve the size of an element with animation if specified. Can also run a callback on complete.

opacity - Manipulate or retrieve the opacity of an element with animation if specified. Can also run callback on complete.

ajax - Get or post data.

location - Manipulate or retrieve the location of an element with animation if specified. Can also run callback on complete.

json - Encode or decode JSON strings.

css - Manipulate or retrieve CSS the properties of an element.

attribute - Manipulate or retrieve the properties of an element.

ready - Runs the specified function on dom ready.

browser - Returns information about the clients browser.