Profile

Achievement

first submission:submitting first snipplet popular snippet:having a snipplet with 20 favorites

1man's Recent Snippets



I didn't realise until now you could do this in jQuery, very useful. Store a value for later use, then remove it.
4 736 posted 15 years ago by 1man
Simple list of commands to use within Adobe AIR to help debug an application.
0 517 posted 15 years ago by 1man
Two different ways to open an external link (ones that start in http) in a new window. I know this isn't a great thing to do, but some clients _need_ to have it.
3 1114 posted 15 years ago by 1man
Two different loading methods for external files.
0 563 posted 15 years ago by 1man
How to create a basic class in AS3 and extend it if needed.
3 806 posted 15 years ago by 1man
Sometimes i forget to remove firebug console commands when debuging, which makes IE and some other browsers fail / cry. To stop this happening use the below script from firebugx.js on the firebug lite homepage.
3 623 posted 16 years ago by 1man
I'm sure i can clean this up quite a bit, but it works for the moment. This function looks to see if you are on a selected page. If you are it hides the navigation, then loops through and shows each li one after the other. So they don't all fade i...
0 627 posted 16 years ago by 1man
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 566 posted 16 years ago by 1man
An example of how to extent the jQuery objects to include our own methods.
0 786 posted 16 years ago by 1man
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 748 posted 16 years ago by 1man
A very annoying 'bug' can occur when you are applying a top margin to an element inside a container. The inner elements margin seems to "leak" out of the top of the container. This pushes the container down, and looks very messy if you have a backgro...
4 738 posted 16 years ago by 1man
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 705 posted 16 years ago by 1man
Very simple style switcher using jquery. Takes 3 links with id's on each. When one is clicked various styles are removed, then a new one is added.
3 921 posted 16 years ago by 1man
Adobe Air has a few security settings that stops you executing certain AIR methods when inside the sandbox. The code below bridges between the root document and the security sandbox, allowing you to open a URL in AIR in a default browser.
1 734 posted 16 years ago by 1man
Apologies if I haven't explained this to well, I'm still trying to get my head round closures.
0 556 posted 16 years ago by 1man
This method allows you to call a function as a method of another object. The first argument the call method expects is the object it is to operate on. Any others are part of the function. Note how the this keyword now refers to the comp object, so a...
0 582 posted 16 years ago by 1man
The important thing to notice is the () operator in a[2]. It is invoking the function inside a[0] with the argument a[1].
1 660 posted 16 years ago by 1man
Every function has an object called the arguments object. This is an object that contains all the arguments that were passed to the function. The example below shows how to access these. Very rarely used but useful to know. Note: it may look like an...
2 715 posted 16 years ago by 1man
Simple way of allowing functions to take optional arguments. Always place the optional arguments last, so you don't have to explicitly pass an argument as "undefined".
3 655 posted 16 years ago by 1man
Basic usage of the in and instanceOf operators.
0 655 posted 16 years ago by 1man
Very simple drag and resize function.
1 760 posted 16 years ago by 1man
Very basic way to toggle an element to slide in and out using mootools 1.1. Uses FX.Slide, other transitions are available.
2 720 posted 16 years ago by 1man
This allows you to replace the bog standard browser button (form buttons) with any image you wish.
9 856 posted 16 years ago by 1man
Create a simple object and add properties and a method. Note where the object is parsed (not from top to bottom).
2 618 posted 16 years ago by 1man
Taken from a lynda.com tutorial on learning actionscript. Lots of comments for the moment.
0 553 posted 16 years ago by 1man
This will run the message function until countInterval equals 10, then it will stop. Could be used in various animations.
0 567 posted 16 years ago by 1man
For forms with a default value onload you don't want your users to have to select the value, delete it and then insert their own input. This function focuses on a selected input, then it selects the default text so the user can easily type their o...
1 718 posted 16 years ago by 1man
CSS image replacement with no extra span needed.
3 558 posted 16 years ago by 1man
Say you want a containing block with 2 floating elements to expand around the floating element, usually this wouldn't happen since the container has no height because the floating elements are out of the usual flow. The method below fixes this pro...
3 602 posted 16 years ago by 1man
Simple way to check see if a file exists and is readable before you include it. Stops nasty error messages onscreen.
5 976 posted 17 years ago by 1man