Welcome To Snipplr


Everyone's Recent Snippets



1 ... 529 530 531 532 533 ... 553
Based on the linked SitePoint article but with options to limit the container (eg body copy) and set the target. Use '_blank' for a new window for each link. Also adds a class (based on the rel value) for styling. Call the 'relWindow' on window load.
2 1570 posted 18 years ago by mountainash
0 1113 posted 18 years ago by ryanprel
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 1943 posted 18 years ago by 1man
3 2631 posted 18 years ago by gtcaz
3 1501 posted 18 years ago by soxiam
2 1319 posted 18 years ago by gtcaz
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 1816 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 1914 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 1368 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 1340 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 1358 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 1134 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 1194 posted 18 years ago by vanne
Displays a image inside link_to instead of text.
2 1611 posted 18 years ago by ryanprel
7 1116 posted 18 years ago by frankyfish
0 984 posted 18 years ago by drwitt
1 1021 posted 18 years ago by drwitt
1 1419 posted 18 years ago by rengber
1 1263 posted 18 years ago by andyh
Extend any float object to allow for decimal conversion
1 1148 posted 18 years ago by vanne
0 1302 posted 18 years ago by gndprx
Weird issue with Intellisense and the HitTestInfo class. Just type it in, it will compile.
1 1754 posted 18 years ago by rengber
Add this to your ~/.irbrc file and you will have inline logging in the console
1 1149 posted 18 years ago by vanne
1 ... 529 530 531 532 533 ... 553