Welcome To Snipplr
Everyone's Recent Snippets Tagged jquery
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
A javscript snipped which will mark each table cell with a CSS class containing the cell's column number. This allows you to set the table column widths using just one CSS rule and without hand editing the table HTML code. This is to workaround the l...
0
1464
posted 15 years ago by miohtama
Easily target elements which have certain attributes using jQuery
1
581
posted 15 years ago by davebowker
I'm new to jQuery, so please be kind if there are any errors or redundancies in the code.
The problem: Basically, we were getting tons of scammers signing up on our Kickapps hosted community. They were immediately posting dozens of RSS feeds & lin...
0
1105
posted 15 years ago by Jdonner
1) if jQuery is already loaded into a browsers' cache -> do nothing
2) if the object is undefined, write a script-element into the source which references google's minified jquery file.
3) if jQuery is still undefined (let's assume Google is down)....
2
926
posted 15 years ago by iroybot
Couldn't find a better way to do this, nor could I find it on teh interwebs, so here it is.
2
1242
posted 15 years ago by wjbrown
Used this on a project to determine whether images were loaded or not. In an image carousel, for example, you could test the next/clicked image before advancing the slide, and if 'loaded' wasn't 'true', you could add a "loading" class and attach a ne...
3
653
posted 15 years ago by dougunderscorenelson
One way to fix many of the issues with IE7 is to dynamically reverse the default z-index stacking order of the elements on your page. This will ensure the elements higher in your HTML source will also have a higher z-index order on your page, solving...
3
909
posted 15 years ago by justinseiter
Modified the code very slightly to add in cursor states for when the timeline is grabbed. Also added in (but commented out) the code to make the sliding twice as fast using a multiplier.
0
738
posted 15 years ago by davebowker
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
1123
posted 15 years ago by 1man
Quickly get the index of the current element. I find myself re-using this several times in a document, so I made a lil' function for it.
3
1279
posted 15 years ago by dougunderscorenelson
This is the code to add to a website to listen for the Konami Code (as implemented on jQuery.com"
6
898
posted 15 years ago by JakeCarter
If you ever need to list all the internal functions of JQuery without the use of googling. You can always use the following command with firebug.
1
853
posted 15 years ago by chrisjlee
Version differs slightly from the demo, as the src for the thumbnail image is a child of the demo example, so has been slightly modified.
0
879
posted 15 years ago by davebowker
Enable jQuery on any website, just clicking on a bookmarklet with this code. Or drag & drop this on your bookmark bar: <a href="javascript:(function(){var%20s=document.createElement('script');s.setAttribute('src','http://ajax.googleapis.com/ajax/libs...
4
851
posted 15 years ago by danielfilho
I was asked to add Recaptcha' to an already existing form. I didn't want to interfere with the code so I decided to search for some sort of AJAX solution. Here's my implementation of DarkSideOfTheCarton.com. This form needs to have a form with <fo...
1
1517
posted 15 years ago by chrisaiv
Use javascript to add a class of last onto the first and the last li tags in the navigation (add to global.js). Then use css to style. For instance, if the first li is home, you can set the css to hide this link (if you want the logo to act as your h...
5
1098
posted 15 years ago by kstetson
This is a @property to take care of jsonp stuff if you're using CherryPy.
In your Javascript, (you're using JQuery, right?) you can do
`
$.ajax({url:"localhost:8080/MyMethod", data:{'arg1':'foo'}, dataType:"jsonp", success:onMyMethodComplete});
`...
0
669
posted 15 years ago by ndnichols
Used to share between a single instance of jQuery through iFrames. Do note, the iFrame content must originate from the same domain, or this plugin will NOT work as expected.
4
1261
posted 15 years ago by garside
I made an absolute tinny code to find the highest z-index of absolute DIV
to show my shouting box and to make it appear absolutely at the top of all html elements.
I used selector of â€body > *‘ instead of ‘body *‘.
â€body > *‘ means...
2
1078
posted 15 years ago by adnan