Welcome To Snipplr
Everyone's Recent jQuery Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Hide parent element, when child element has a specific class.
In this case:
child element = .no-news-found
parent element = .csc-default (= content element containing the news plugin with header)
0
1010
posted 6 years ago by xtine777
Here’s a super handy snippet that I use very often. It works very simply: once the user clicks on #submit, the data from #form is serialized and sent to a remote page using the POST method.
0
1972
posted 7 years ago by catswhocode
IIFE - Immediately Invoked Function Expression.
http://gregfranko.com/jquery-best-practices/#/7
http://gregfranko.com/jquery-best-practices/#/8
0
954
posted 9 years ago by Waltem
Add class .green to class .payment-container and make it flash every 3 seconds
0
924
posted 9 years ago by envane21
Used to automatically scroll up the page so that it is focused on user entry (mobile devices)
0
856
posted 9 years ago by envane21
First you need to write your script. In your theme folder create a folder called something like 'js'. Create a file in that folder for your javascript. E.g. your-script.js. Add your jQuery script to that file (you don't need <script> tags in a .js fi...
0
1471
posted 9 years ago by designermedia
Useful when using a template or Wordpress and the LeadPages code is called on every page and there is a single page you don't want the fancy exit marketing signup form to appear.
The LeadBox external code has a boolean variable called 'safetyCheck...
0
893
posted 9 years ago by mountainash
To check if an “enter†key is pressed inside a textbox, just bind the keypress() to the textbox.
0
1238
posted 9 years ago by luhonghai
To detect copy, paste and cut behavior, you just need to bind the corresponding event type.
0
1637
posted 9 years ago by luhonghai
To check if jQuery library is loaded, use the following JavaScript code
0
1120
posted 9 years ago by luhonghai
JQuery is really a powerful and handy JavaScript library. The page or content loading effect is very easy to implement in jQuery. Here’s a example to make your web page content display a fade in page loading effect
0
1029
posted 9 years ago by luhonghai
Bei dieser Variante lassen sich die Checkboxen nur einmal aktivieren/deaktivieren. Bei weiteren Versuchen wird zwar im Quelltext altiviert/deaktiviert, es ist aber auf der Seite nicht zu sehen.
0
948
posted 9 years ago by ulfinger
The purpose of this hook method is to help provide a separation of concerns between CSS and JavaScript.
Typically class names are used to attach JavaScript to HTML elements. Using a separate data-hook attribute helps to protect the scripting from...
0
948
posted 9 years ago by pmw57
Mit dem php-Script innerhalb der Seite wird aus der SQL-Datenbank ein Javascript-Array zusammengestellt. Darauf greift das autocomplete-Widget zu.
0
1047
posted 9 years ago by ulfinger
Please visit http://pantuts.com/2014/09/21/quicknote-jquery-plugin/ for other included files and demos. Thanks
0
1013
posted 10 years ago by pantuts
Méthode n'autorisant que les nombres (positifs/négatifs/décimaux avec virgules ou points) dans un champ
0
1028
posted 10 years ago by Igeco
N'autorise que les chiffres (avec , ou . ou négatifs) dans un input
0
964
posted 10 years ago by sebabarre
The code is meant to find out electrical dc power using formulas p=vi, P=v<sup>2</sup>/R, and P=i<sup>2</sup>*R.
0
876
posted 10 years ago by KhanOf21Century