Javascript

Code Snippet NameSort by Category CategorySort by Category Submitted BySort by Person   Date

Input action on enter

Javascript 02/17/12
This javascript snippet allows you to run javascript or just submit the form on the enter keypress. View Code

Tags

Scroll to bottom

Javascript 09/13/11
This is a javascript snippet to scroll the browser window to the bottom. I made it for a footer login form that when opened was below the bottom edge of the browser.
This works in ie9, firefox and chrome View Code

Tags

Document Onload

Javascript 06/23/11
Here is an alternative to using the buggy onload event in javascript. View Code

Js Cookie

Javascript 06/13/11
Here is a quick snippet to get you started creating cookies with javascript. View Code

Remember scroll position

Javascript 06/13/11
This is a great piece of code, use it to remember the scroll position when you submit a form.

Just load the script and add this to the template: <body onunload="unloadP('UniquePageNameHereScroll')" onload="loadP('UniquePageNameHereScroll')"> View Code

Tags

Y scroll positon

Javascript 06/08/11
This is a semi cross browser friendly way to detect the scroll position of the browser. I tested it in Firefox4, Chrome and IE9. View Code

Tags

Back btn for iframe

Javascript 05/23/11
Use this javascript to take an iframe back one page. Basically you create a remote back button for your iframe in an attempt to control the iframe browsing. View Code

Tags

Font replacement bugfix

Javascript 05/19/11
This is a script that prevents the annoying flashing of text fonts in firefox when you use font replacement.(Follow reference page link below) If you simply must have non web-safe fonts and are easily annoyed by imperfection and bugs, you may need this. View Code

Tags ,

Jquery UI Calendar with From and To

Javascript 05/13/11
This snippet in conjunction with Jquery and Jquery UI will allow you to have a calendar datepicker that will not let you select a "end date" that is before the "start date" View Code

Tags ,

Detect Keystrokes

Javascript 05/08/11
This is a testing script for keystrokes, this one is set to detect the ctrl + space keystroke. View Code

Tags

Javascript print_r

Javascript 03/17/11
This is a fake print_r routine for javascript arrays and objects. View Code

Cross browser javascript events

Javascript 03/17/11
These are a couple custom event systems that both work well, I found this one after posting the below code and you should check it out first: http://www.josh-davis.org/node/4

As an actionscriptor, if that's how you spell it I am very comfortable with Josh Davis' system. If you want a cross ... View Code

Tags

Detect mouse coordinates

Javascript 03/12/11
This is a cross browser solution to detecting the mouse x and y coordinates in the browser. This javascript simply stores the x and y value, you can access them globally using the variable names mouseX and mouseY View Code

Fader for elements

Javascript 03/12/11
This javascript routine allows you to fade elements in and out by id. Just add a trigger with an onclick method to call the fader.

<span onclick="ezbFade('elementid',1000);"></span>

The first argument is the id of the target element and the second is the fade time in milliseconds.

View Code

Detect mouse out of browser

Javascript 03/08/11
Use this javascript code to detect if the mouse leaves the browser window. View Code

Tags

If class exists styling

Javascript 03/08/11
This is another big commerce snippet that allows you to control the display and styling of elements based on the existence of an element with a certain classname.

I built this as a switch to style the content area differently if there is a breadcrumb div on the page. You can substitute any ... View Code

Tags