Welcome To Snipplr


Everyone's Recent JavaScript Snippets



1 ... 60 61 62 63 64 ... 67
In IE5 and IE6 the transparancy in PNG images won't happen at all, so this would fix it. This might come really useful while we are in the era of switching to better standard-friendly browsers.
7 435 posted 14 years ago by iTony
Based on the linked SitePoint article but with options to limit the container (eg body copy) and set the target. Use '_blank' for a new window for each link. Also adds a class (based on the rel value) for styling. Call the 'relWindow' on window load.
2 362 posted 14 years ago by mountainash
Function to look if an element has a class, if it doesn't simply add it to the element. If it does have a class add it to the class that is already there. Function expects 2 values, the element to add the class to, and the new class name (value).
3 476 posted 14 years ago by 1man
This function looks for tables in a web page, then loops through the rows and sets the backgroundColor for ever other row.This creates a striped table which is easier to read.
2 411 posted 14 years ago by 1man
Use this function to queue functions you wish to load on window onload. Very useful when code becomes complex.
3 514 posted 14 years ago by 1man
Usage of the getNextElement function. Very basic usage to pick out the h1 tags, then change the properties of the next element(not node).
1 362 posted 14 years ago by 1man
Useful function for CSS DOM, returns the next element after the selected node. So you could style the element directly after a h1 element for example.
2 289 posted 14 years ago by 1man
Haven't had a chance to use this but it looks very promising.
14 643 posted 14 years ago by aznprncritic
A great script that will serve up stylesheets based on browser viewport size.
5 460 posted 14 years ago by aznprncritic
This is another script from the DOM scripting book. Not really relevant to anybody else. Useful for reminding myself about the DOM.
1 306 posted 14 years ago by 1man
Not really relevant to anybody else. Full unobtrusive js file for a simple gallery. From DOM Scripting by Jeremy Keith (superb book, highly recommend it for anyone looking to move into DOM scripting)
2 277 posted 14 years ago by 1man
Vert useful function since there isn't an insertAfter function in the DOM. Call it inside scripts, it expects insertAfter(*the new element to be inserted*, *the element you want it to be inserted after*);
3 1098 posted 14 years ago by 1man
when testing forms you don't always want to fill in dummydate this is a function i used to autofill and select values.
1 301 posted 14 years ago by assbach
Handy for after submitting a form or moving sites and wanting to tell users about the change. Just change the URL (can be absolute or relative) and the timeout. Shown here as 5 seconds.
5 502 posted 14 years ago by mountainash
Trims leading and trailing spaces from a string value and returns the result as a new string.
1 443 posted 14 years ago by splorp
paste above in HEAD tag
1 298 posted 14 years ago by clapfouine
in javascript use, for example: myJsonObject["js007"].firstname + ' ' + myJsonObject["js007"].lastnamename to return James Bond
1 342 posted 14 years ago by markireland
This is a prototype based method for loading functions, this is an alternative to using window.onload = function();
1 299 posted 14 years ago by vanne
Helps identify correctly the type of whatever you put as an argument. This was adapted from http://www.planetpdf.com/developer/article.asp?ContentID=testing_for_object_types_in_ja
3 380 posted 14 years ago by rolandog
交互に背景色を変えるスクリプト. XHTML basic templateと合わせて参考にどうぞ. 本当はCSSクラスを振って, スタイルはCSSで付けたほうがいいけど取り急ぎ.
1 281 posted 14 years ago by masaya
Mirror of library
2 1009 posted 14 years ago by jmah
Simple extension of the string method using string.prototype.
1 324 posted 14 years ago by 1man
run at pukiwiki and bwiki(xoops module)
0 290 posted 14 years ago by kyokutyo
Makes the comment box on a xanga entry transparent
2 399 posted 14 years ago by sondosia
Removes the ad at the top of a xanga page; place in Webstats below all other codes This one actually works, even in Opera and Firefox,
2 356 posted 14 years ago by sondosia
In Internet Explorer, it's a well-known issue that tags are rendered above other layers and things like drop-down menus. This fix is specifically for the "Son of Suckerfish" drop-down menus (see URL), which are entirely CSS-based (JS is needed only...
1 410 posted 14 years ago by Todd
1 ... 60 61 62 63 64 ... 67