Welcome To Snipplr


Everyone's Recent jQuery Snippets



The snippet below was pulled from code that loads a list of names pulled from Active Directory into a listbox. This code will execute when the user double clicks on a name in the list box (lstResults) and stores it in a variable to be passed to anoth...
0 537 posted 9 years ago by mattvbiggs
myEls should be the selector statement for whatever elements you want to effect. The example wraps every 3.
1 723 posted 9 years ago by adambundy
In scripts.js
0 863 posted 9 years ago by wanlapat
Handy code snippet for keeping track of the number of characters a user is entering into a textbox or textarea. It will dynamically update the count as the user is typing. This also works with copy & paste. The top snippet will automatically calcu...
2 452 posted 9 years ago by mattvbiggs
I have made a small jQuery snippet to demo the image swapping with attr() funciton. The demo uses 2 images with classes img1 and img2 respectively. On a click of a button, the images are swapped. Basically the script stores “src” value into...
0 544 posted 9 years ago by vijayrajesh
By storing or by having the Iframe embed code as a variable, You can play the Youtube video on a click of a button or any other event. I have used “append” function of jQuery to append the IFrame code dynamically inside a DIV tag.
0 1211 posted 9 years ago by vijayrajesh
The thumbnails of Youtube videos are generally low in quality. Sometimes, the thumbnail is not enough to get the people attention. Here is a small code I have written that works as follows. A custom thumbnail is displayed at the size of 560px wi...
0 709 posted 9 years ago by vijayrajesh
in jquery mobile, .html() not refresh DOM. Execute this function after any DOM change.
0 654 posted 9 years ago by goo
you can use this minified jQuery snippet to detect if your user is viewing using a mobile device.
1 764 posted 9 years ago by goo
This is a skeleton template for a jquery plugin with custom methods
1 528 posted 9 years ago by rickygri
This can come in handy for a reset or cancel button. You can clear all inputs within a single div in one line of code. Pretty sexy.
0 576 posted 9 years ago by mattvbiggs
jQuery
0 346 posted 9 years ago by msstar
mi comment
0 467 posted 10 years ago by darvein
The difference between jQuery.extend() and jQuery.fn.extend()
1 494 posted 10 years ago by msstar
.on( events [, selector] [, data], handler(eventObject) ) A delegated-events approach attaches an event handler to only one element, the tbody, and the event only needs to bubble up one level (from the clicked tr to tbody):
0 494 posted 10 years ago by grindking
A very good slider / carousel. Um slider / carrossel muito bom. Ideal para designs responsivos.
0 436 posted 10 years ago by nivasgallo
This code allows Google Analytics to monitor hashtags of jQuery activated events. Very useful if you relies on modal boxes. Este código permite ao Google Analytics monitorar hashtags e âncoras em sites com eventos ativados por jQuery. Muito út...
1 407 posted 10 years ago by nivasgallo
raty named jquery plugin for star rating
0 422 posted 10 years ago by ggmittal
For some reason setting a default value for select elements does not work. This one line of jquery solves that problem. Assign a value (value="something") to the select tag that is to be the default value. With jquery get all select elements with a...
0 876 posted 10 years ago by halk
This will monitor the status of all ajax calls on the page. When ajax starts i show an animated spinner gif and display a message that ajax has been requested. On completion of a call the status returned is displayed and the spinner is hidden to in...
1 536 posted 10 years ago by halk
Logging In with InstaLib
0 388 posted 10 years ago by kreativemente
If you have a list of images and want'them all to preload before page is shown. This function is very useful. I use it in various cases working with Phonegap to get my app a better native experience.
0 474 posted 10 years ago by bernhardb
Smart Time Ago is a little jQuery library to update the relative timestamps in your document intelligently.
0 519 posted 10 years ago by praveensewak
Quite useful snippet to log all events triggering occuring in your app. Because it uses event.global array, it logs custom events as well as native ones For developpement use only, disable it before migrating to production environement.
1 326 posted 10 years ago by mandawan
If someone put text into an input field (or automatic e.g. with a 2d barcode scanner) and you want to replace a part of the input (pattern) then will help this small jquery code snippet.
0 662 posted 10 years ago by bassdas
obviously one can access HTML5's data attribute super easy in jQuery
0 550 posted 10 years ago by iroybot
Used to automatically give feedback on email address validity.
0 496 posted 10 years ago by boondoklife
This is some code that creates an effect for jQuery Cycle to scroll up when you click the down button and down when you click the up button - like a scrollbar.
0 573 posted 10 years ago by JoshChris
This is a pretty standard jQuery method to listen for the enter key and simply "click" the button. However, if you are using a LinkButton this code will not work. The reason for this is that a LinkButton is rendered to the browser as an Anchor tag...
0 381 posted 10 years ago by weldonr30
A complete lightbox with minimal code and full functionality: close button, close on escape keypress, close on lightbox blur event.
1 403 posted 10 years ago by mortu