Welcome To Snipplr
Everyone's Recent Snippets Tagged c
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Function to look if an element has a class, if it doesn't simply add it to the element. If it does have a class add it to the class that is already there. Function expects 2 values, the element to add the class to, and the new class name (value).
3
2072
posted 18 years ago by 1man
This function looks for tables in a web page, then loops through the rows and sets the backgroundColor for ever other row.This creates a striped table which is easier to read.
2
1923
posted 18 years ago by 1man
Use this function to queue functions you wish to load on window onload. Very useful when code becomes complex.
3
2140
posted 18 years ago by 1man
Usage of the getNextElement function. Very basic usage to pick out the h1 tags, then change the properties of the next element(not node).
1
1474
posted 18 years ago by 1man
Useful function for CSS DOM, returns the next element after the selected node. So you could style the element directly after a h1 element for example.
2
1430
posted 18 years ago by 1man
Use this to display a file properly if you are reading it from another location and wish to direct it to the user's browser
0
1496
posted 18 years ago by wolfie
This is just a collection of shortened SVN commands (may take a split-second of time less than normal)
0
1276
posted 18 years ago by mountainash
Add this inside your .irbrc file to call "show Model" in your console instead of "y Model.column_names"
1
1268
posted 18 years ago by vanne
Weird issue with Intellisense and the HitTestInfo class. Just type it in, it will compile.
1
1851
posted 18 years ago by rengber
Add this to your ~/.irbrc file and you will have inline logging in the console
1
1250
posted 18 years ago by vanne
Haven't had a chance to use this but it looks very promising.
14
2206
posted 18 years ago by aznprncritic
A low-tech but useful technique that uses only CSS. After placing the css in your stylesheet, insert this just below the body tag of your page: "". Whenever the images are referenced throughout your pages they will now be loaded from cache.
0
11465
posted 18 years ago by aznprncritic