Welcome To Snipplr


Everyone's Recent JavaScript Snippets



1 ... 55 56 57 58 59 ... 65
1 758 posted 16 years ago by gbot
Quick example to show how 'this' depends on how the function in which you called it in was being invoked. From jQuery in Action.
1 744 posted 16 years ago by 1man
An example of how to extent the jQuery objects to include our own methods.
0 957 posted 16 years ago by 1man
Usage: onmouseout='if (isMouseLeaveOrEnter(event, this)) YourActionHere();' onmouseover='if (isMouseLeaveOrEnter(event, this)) YourOtherActionHere();'
1 861 posted 16 years ago by Winkyboy
Para realizar validaciones en Javascript rápidamente. Requiere que en la etiqueta metamos un onSubmit="return checkform(this);" . Este trozo de código es para dos campos input con nombres campo1 y campo2.
0 520 posted 16 years ago by betacontinua
If you have a complex function you may need to pass it lots of arguments. Instead of having to remember how many you need to pass, and passing 'null' for un needed arguments, pass the function an object. Now you can set the defaults inside the fun...
0 905 posted 16 years ago by 1man
I got this code from http://blog.vishalon.net/Post/57.aspx The actual two methods required are function doGetCaretPosition (ctrl) { var CaretPos = 0; // IE Support if (document.selection) { ctrl.focus (); var Sel = document.select...
3 4329 posted 16 years ago by arunpjohny
/* ---===[ EXAMPLE ]===--- */ var TT = new AssociativeArray(); TT.add("k-1", "Value 1"); TT.add("k-2", "Value 2"); TT.add("k-3", "Value 3"); TT.add("k-4", "Value 4"); alert(TT.to_string());
1 637 posted 16 years ago by vbert
/* --==[ EXAMPLE ]==-- var colors = new AArray(); colors.add("k01", {bk:"#fff",tk:"b",it:"hello"}); var oC = colors.get("k01"); var tT = ''; for(K in oC) tT += "[" + K + "]: " + oC[K] + "\n"; tT += "\n\n"; tT += oC.bk + "\n"; tT += oC...
1 975 posted 16 years ago by vbert
Wasn't fully tested :) Just for reference...
3 765 posted 16 years ago by oxisound
(c) copyright Stephen Chapman, 1st Jan 2005. Example: alert('http://'+uri.dom+uri.path+'/folder/file.js');
0 729 posted 16 years ago by oxisound
This makes it easy to retrieve certain value from a url with different values appended to it.
0 961 posted 16 years ago by iTony
prevent errors in other browsers
0 916 posted 16 years ago by localhorst
This would make IE treat the hover element in whichever tag you implemented.
0 498 posted 16 years ago by iTony
curvyCorners is a free JavaScript program that will create on-the-fly rounded corners for any HTML DIV element, that look as good as any graphically created corners.
3 1156 posted 16 years ago by jonhenshaw
Will toggle an element's style.visibility, or set it to visible/hidden as selected
0 764 posted 16 years ago by martinkas
2 961 posted 16 years ago by xalexx
0 696 posted 16 years ago by ecavazos
Then, your code should look like this ... $(document).ready(function() { $("dt > a").click(function(){ $(this).parent().nextUntil('dt').toggle(); return false; }); });
0 693 posted 16 years ago by thecrumb
#modal would be the bodyID of your modal window. I use jqmodal so it strips out all the header tags, and takes your body ID and turns it into a div.
2 763 posted 16 years ago by kristin
Found this quick little bit of code on the Google jQuery discussion group. It simply fades the background image of a link you have hovered over to a certain color, then fades it back to the original color.
4 891 posted 16 years ago by 1man
This is to prevent a form from being inadvertently submitted.
0 802 posted 16 years ago by ecavazos
1 ... 55 56 57 58 59 ... 65