Welcome To Snipplr


Everyone's Recent Snippets Tagged jquery



You'll need to download the latest version of jQuery for this to work, as it is linked in the tag. CSS/XHTML included.
15 4174 posted 17 years ago by dmosher
1 1418 posted 17 years ago by shellydennison
3 1850 posted 17 years ago by iTony
I wrote this very quickly for a form I parse that allows a user to send a page to up to 5 friends. The script adds a click event to an image of a + sign beside an input box. When clicked if the user hasn't already added 5 friends to email, additional...
9 1791 posted 17 years ago by dmosher
7 3396 posted 17 years ago by Juego
After having trouble with xss and .getJSON() I wrote this. Solved my problems so here you go.
3 1328 posted 17 years ago by twoism
Smooth scroll to anchor links, requires Interface plugin
9 1911 posted 17 years ago by madmanlear
0 1028 posted 17 years ago by rblalock
Accessing JQuery's $() shortcut within WordPress
1 1280 posted 17 years ago by melvitax
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 1366 posted 17 years ago by 1man
An example of how to extent the jQuery objects to include our own methods.
0 1641 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 1469 posted 17 years ago by 1man
Say you wanted the following 4 tabs: bodoni, helvetica, frutiger, univers, each outputting a separate block view of 3 teasers each. This is what your markup would look like:
1 1133 posted 17 years ago by zachharkey
4 1454 posted 17 years ago by AgentPhoenix
Then, your code should look like this ... $(document).ready(function() { $("dt > a").click(function(){ $(this).parent().nextUntil('dt').toggle(); return false; }); });
0 1256 posted 17 years ago by thecrumb
#modal would be the bodyID of your modal window. I use jqmodal so it strips out all the header tags, and takes your body ID and turns it into a div.
2 1367 posted 17 years ago by kristin
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 1464 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 1841 posted 17 years ago by 1man
0 1211 posted 17 years ago by kristin
a function that returns the absolute position in DOM tree. jQuery based
1 1323 posted 18 years ago by fael
basic wrapper for jQuery code
4 1347 posted 18 years ago by sambody
12 1703 posted 18 years ago by soxiam
6 1993 posted 18 years ago by soxiam
Replaces a DOM Element with another, but keeps the classes and IDs of the old one.
3 1665 posted 19 years ago by gaunab