Profile

Achievement

first submission:submitting first snipplet popular snippet:having a snipplet with 20 favorites

1man's Recent SnippetsTagged jquery



« Prev 1 Next »
Useful snippet i found on a forum, use it to check to see if a user is old enough to submit a form.
2 1821 posted 14 years ago by 1man
Handy little snippet i found in 'jquery enlightenment' for caching certain selected files. Could be useful for larger files later on in a site.
1 1704 posted 15 years ago by 1man
Simple plugin to demonstrate how the 'this' keyword is used. Plugin also allows chaining via the 'return'
0 1581 posted 15 years ago by 1man
Example in 'jQuery enlightenment' Simple way to jump smoothly down the page without the use of a plugin.
3 1443 posted 15 years ago by 1man
Example given in the book jQuery Enlightenment. Create your own custom selectors in jQuery and manipulate as usual.
0 1330 posted 15 years ago by 1man
Very simple example of pulling in a JSON feed from Yahoo pipes using jQuery.
0 1706 posted 15 years ago by 1man
Quick little clientside script to pick out every 3rd image and add a class of last to it. I needed this because the images were layed out in 3 columns, adding a margin to the right hand side would leave a large gap on the right hand side which i d...
0 1553 posted 16 years ago by 1man
Great little snippit to add a <tr> to the bottom of a table. Note the use of the context in the jQuery e.g var n = $('tr:last td', this).length; Will have to use this in the future, very good to know!
4 2655 posted 16 years ago by 1man
A very simple plug-in I wrote to make x number of columns equal height. Looks for the column with the biggest height then sets the rest to the same. I'm sure it can be made cleaner, will look into that later.
4 1582 posted 16 years ago by 1man
Adding a namespace to an event can make it easier to unbind. It is very easy to unbind all events with the same namespace.
1 1352 posted 16 years ago by 1man
Never used the index() method in jQuery but could be useful to know. Find a selected elements index when you click on it. Note the $('ul#mylist') inside the index method, gives the search some context of where to look for .selected, saves looking thr...
1 1329 posted 16 years ago by 1man
Simple imagefader to rotate around a few images. Seem to be doing this a lot in various projects so decided to put something a bit more generic together. Uses jQuery. Images named as car1.jpg, car2.jpg, car3..... etc.
3 1528 posted 16 years ago by 1man
Click on an input field with a prefilled value, if that value equals the default then select it, if not leave it as it was. Relies on jQuery.
2 1921 posted 16 years ago by 1man
Using JSON-P with jQuery. Note the callback.
0 1360 posted 16 years ago by 1man
I didn't realise until now you could do this in jQuery, very useful. Store a value for later use, then remove it.
4 1348 posted 16 years ago by 1man
Two different ways to open an external link (ones that start in http) in a new window. I know this isn't a great thing to do, but some clients _need_ to have it.
3 1839 posted 17 years ago by 1man
I'm sure i can clean this up quite a bit, but it works for the moment. This function looks to see if you are on a selected page. If you are it hides the navigation, then loops through and shows each li one after the other. So they don't all fade i...
0 1204 posted 17 years ago by 1man
An example of how to extent the jQuery objects to include our own methods.
0 1459 posted 17 years ago by 1man
If you have a complex function you may need to pass it lots of arguments. Instead of having to remember how many you need to pass, and passing 'null' for un needed arguments, pass the function an object. Now you can set the defaults inside the fun...
0 1323 posted 17 years ago by 1man
Found this quick little bit of code on the Google jQuery discussion group. It simply fades the background image of a link you have hovered over to a certain color, then fades it back to the original color.
4 1324 posted 17 years ago by 1man
Very simple style switcher using jquery. Takes 3 links with id's on each. When one is clicked various styles are removed, then a new one is added.
3 1655 posted 17 years ago by 1man
« Prev 1 Next »