Welcome To Snipplr
Everyone's Recent jQuery Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Just replace classic document.ready with pageLoad function as belows:
pageLoad function will called on all postback and partial postbacks. So it makes the jquery code no matter what :D
Even in update panel.
1
778
posted 14 years ago by delikassap
This plugin will, by default, truncate a block of text down to one line at its current width (if the text block exceeds 1 line). You can also pass in a pixel value and it will truncate it to that width.
0
1121
posted 14 years ago by adamcoulombe
Con esto evitamos que un enlace que tengamos con 'href="#"' actue como tal y la pagina haga scroll hasta la parte superior.
0
608
posted 14 years ago by jacinmontava
I was recently faced with the problem of setting focus to the next input field. The challenge was that I didn’t know what that field was. So given an input field, find the next logical (in the order of the DOM) input field and set focus. I came up...
1
1166
posted 14 years ago by Meander365
I can't help thinking that good use of jQuery & Javascript must use extensive comments
0
997
posted 14 years ago by PandaWood
add a value to your text input e.g. "Enter keywords" and clear on-click
0
816
posted 14 years ago by flicity
This is an improvement on http://snipplr.com/view/11583/retrieve-url-params-with-jquery/
I found IE wasn't liking the results[1] when no param was set. This fixes that issue.
6
3239
posted 14 years ago by geekyjohn
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
1261
posted 14 years ago by 1man
Simple plugin to demonstrate how the 'this' keyword is used. Plugin also allows chaining via the 'return'
0
1118
posted 14 years ago by 1man
Since :first-child and :last-child aren't compatible with all modern browsers I thought I'd post this snippet. It make automating the class creation easier too instead of having to remember when typing up your HTML or creating logic in your programm...
3
968
posted 14 years ago by smoothdzion
Example in 'jQuery enlightenment'
Simple way to jump smoothly down the page without the use of a plugin.
3
1047
posted 14 years ago by 1man
Example given in the book jQuery Enlightenment.
Create your own custom selectors in jQuery and manipulate as usual.
0
966
posted 14 years ago by 1man
Basic skeleton for a plugin. Contains an example to show where code needs to go.
2
658
posted 14 years ago by ira
bit shabby and should really never do this but hey!
Takes an id selector of a ul and expects the ul to be ul>li>a which gets converted into an option list which changes the destination url of the anchor button beneath on select change. bah.
0
1253
posted 14 years ago by ReeceMarsland
Great short snippet of code to toggle checkboxes.
Thanks [Josh Nathanson](http://groups.google.com/groups/profile?enc_user=aAOlJRcAAAC7dB8ku2NsRGdjbPtXhPEXHqZiDvCVswhrZ6TQxKj0ww) for putting this simple code together.
6
865
posted 14 years ago by smoothdzion
the plugin model in JQuery takes advantage of JavaScript’s prototype inheritance and makes it trivially easy to add new chainable methods
1
837
posted 14 years ago by magicrebirth
Here is a nice snippet to open links in pop-up windows. Just add the popup css class to your link to make it work.
3
927
posted 14 years ago by math89
The target="blank" attribute is not valid XHTML 1.0 Strict.
using jQuery, you can achieve the same functionality without having validation problems.
0
732
posted 14 years ago by math89