Welcome To Snipplr


Everyone's Recent Snippets Tagged javascript



1 ... 18 19 20 21 22 ... 46
Handy. Hide an element as soon as possible, before document.ready. The element gets hidden but only when a class is applied to the html via js.
1 1579 posted 15 years ago by Meander365
I can see this being useful for when you want to pass a lot of associated data to an event handler from elements and their chosen trigger action.
1 1869 posted 15 years ago by Meander365
One bind event, multiple events. Handy.
2 1737 posted 15 years ago by Meander365
For those multiple rollovers - and their multiple flashes! The solution is to stop(!) them.
2 1571 posted 15 years ago by Meander365
Dave Metvin\'s method. Two tricks to the method:\r\n\r\n$($boxes[div++] || []) - increaments \"div\" and passes an empty array if the element doesnt exist (so it exists).\r\n\r\narguments.callee - the name of the function currently being executed.
1 1640 posted 15 years ago by Meander365
2 3045 posted 15 years ago by sb_01
0 1336 posted 15 years ago by Eystein
Testing, if Browser supports HTML5 "date" Value for type in input-fields
0 1362 posted 15 years ago by ichnoweb
I’ve seen some very cool parallax effect around lately, especially liking the Silverback site. But none of them are particularly interactive, so I thought I’d make a small implementation of the Parallax effect that interacts with the mouse. Ve...
1 1422 posted 15 years ago by dom111
A simple script that will add captions to images and allow for easy styling.
1 1395 posted 15 years ago by dom111
So recently I was asked to change a navigation style of an existing site to drop-down menus. Simple, I thought, just use one of the many existing drop-down plugins. I tried many, but most seemed to use hardcoded styles and I had a few problems (so...
0 2721 posted 15 years ago by dom111
So recently I was asked to change a navigation style of an existing site to drop-down menus. Simple, I thought, just use one of the many existing drop-down plugins. I tried many, but most seemed to use hardcoded styles and I had a few problems (so...
0 1588 posted 15 years ago by dom111
I\'m constantly testing forms over and over for one reason or another, and am fed up with making a typo and autocomplete not populating all the data, so I made this little snippet. It searches for form elements on the page (input, textarea and select...
1 1863 posted 15 years ago by dom111
Uses html5 geolocation to determine device position and sets this as the starting point for directions on a Google Map. Use modernizer to detect support.\r\n\r\nhttp://diveintohtml5.org/geolocation.html\r\n\r\nhttp://code.google.com/apis/maps/docume...
1 3191 posted 15 years ago by Meander365
Just be sure to slap the div for the chars left message within the same div/p as the textarea so the dom walk works.
1 1726 posted 15 years ago by housecor
Great for those situations where you need an element fixed on a page - so when a user scrolls it stays in the same position - *relative to its parent element*.
0 1811 posted 15 years ago by Meander365
Use this to create a conditional statement for chrome.
0 1387 posted 15 years ago by allnatural
A more flexible version of the 'official' Facebook feed dialog example. "The Feed Dialog prompts the user to publish an individual story to a profile's feed. This does not require any extended permissions." "The following simple JavaScript exam...
0 1782 posted 15 years ago by coprolit
To identify whether javascript is disabled in IE or not
0 1673 posted 15 years ago by hairajeshk
have it as bookmark - clicking on it will validate the current page
1 1227 posted 15 years ago by silviud
Set a cookie that expires at midnight.
1 3375 posted 15 years ago by jonkemp
The cookie expires the number of days from the time it is set.
0 1387 posted 15 years ago by jonkemp
0 1415 posted 15 years ago by jonkemp
Thankfully, Sjoerd Visscher mentioned an interesting technique that could be used to force IE to use the specified CSS styling. Specifically, once you create a new DOM element (of the same name as the one in the document) all styling is applied. [.....
0 1821 posted 15 years ago by stephcode
0 1274 posted 15 years ago by paulstraw
1 ... 18 19 20 21 22 ... 46