Welcome To Snipplr
Everyone's Recent Snippets Tagged javascript
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
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
778
posted 14 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
885
posted 14 years ago by Meander365
For those multiple rollovers - and their multiple flashes! The solution is to stop(!) them.
2
782
posted 14 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
782
posted 14 years ago by Meander365
Testing, if Browser supports HTML5 "date" Value for type in input-fields
0
686
posted 14 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
699
posted 14 years ago by dom111
A simple script that will add captions to images and allow for easy styling.
1
645
posted 14 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
906
posted 14 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
861
posted 14 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
923
posted 14 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
1165
posted 14 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
870
posted 14 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
852
posted 14 years ago by Meander365
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
882
posted 14 years ago by coprolit
have it as bookmark - clicking on it will validate the current page
1
553
posted 14 years ago by silviud
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
834
posted 14 years ago by stephcode