Welcome To Snipplr
Everyone's Recent JavaScript Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This is a JavaScript powered dropdown (flyout) menu. HTML and CSS included.
0
905
posted 13 years ago by zvineyard
This bit of jquery will take whatever you give it in the selector (which should be a valid jquery selector of any kind) and add or remove additional classas as appropriate based on width.
The width and style names are all determined by the last i...
0
885
posted 13 years ago by FatFolderDesigner
This will get the arguments on the query string and put them into a handy array.
0
970
posted 13 years ago by brownrl
Developing a form where I had several date and time fields, I came with a jQuery multiselector where I need to get, through the name attribute, if it was a date or time field. So far, jQuery does not have a boolean method to check if an attribute of...
0
873
posted 13 years ago by betacar
Will produce output like this:
<html>
...
</html>
<html>
...
</html>
Target in CSS like this:
html[data-useragent*='Chrome/13.0'] .nav {background:url(img/radial_grad.png) center bottom no-repeat;}
or
html[data-useragent*=...
0
1027
posted 13 years ago by reverend
Use this to convert JavaScript numbers to official scientific standard form (e.g. 1.54 × 10^3)
Uses HTML <sup> tags and × symbol
Example:
var number = 4.223e20;
var stnd = standardForm(number);
// stnd = 4.223 x 10^20
0
812
posted 13 years ago by Jellybean732
Why do this?
===========
*hopefully* this will cause the page to refresh and provide a stop button in the future. The idea is to use it while developing in a text editor, as in Vim or its ilk, and not have to alt+tab all the _*flipping*_ time.
F...
0
714
posted 13 years ago by inreflection7
found the solution here: http://stackoverflow.com/questions/2790001/fixing-javascript-array-functions-in-internet-explorer-indexof-foreach-etc
0
631
posted 13 years ago by pixelatorz
Simple recursive function to find objects that match the value of str hanging anywhere off the global JS object (window).
0
871
posted 13 years ago by richt
Pass variables into javascript files using query strings, and return them using getJSvars()
Example
//HTML
<script>
//return the value of "foo"
getJSvars('filename.js', 'foo');
0
879
posted 13 years ago by DenoteIt
Thanks to http://www.mredkj.com/javascript/numberFormat.html#addcommas
0
695
posted 13 years ago by fengelz