| |

Fading Pages in Javascript

Note: This article was published while I was in my early 20s. I was much younger and dumber. Please don't hold it against me. One of the perils of having a 20+ year old website!

I am not a huge proponent of Javascript. However, I recognize that it is becoming more and more powerful and used, especially since AJAX has become more popular. With a new redesign of one of my sites, I wanted to do something different and cool- so I looked to 24 Ways. There I found a nice tutorial on using the effects from Script.aculo.us. Using that tutorial and some extra programming, I was able to create fading “pages”, which are actually divs we fade in and out.

First of all, you must follow the 24 Ways tutorial. I have made all of the javascript from that tutorial available in this post, and then my modified combo.js. All of my changes occur in that. Once you read that 24 Ways Tutorial, come back here.

So by now, you are familiar with all of the files, and the main functions provided in the combo.js. I took combo.js and modified it a little here:

JS Code

Notice I added a few lines at the top of the function. On top of that I added this to my main page:

JS Small

These codes create and check cookies, which is what I used to check what “pages” were open. When a page is open (when the page is first loaded, it is welcome), a cookie created with the name of that page. When a new page is clicked on, my code checks the cookie to see what is currently open, then closes it. After that, the cookie is rewritten with the new page open. The cookie functions are included in my combo.js. When it is all said and done, we have this. Later!

Similar Posts

  • | |

    My Landing Page Checklist

    Lately I’ve been building a bunch of landing pages for various projects, courses, and digital events. And ever since reading Marketing Made Simple by Donald Miller, I’ve been putting a lot more effort into them in hopes that they provide better information and convert. To make sure I cover everything I need to, here’s my…

  • | |

    How to Export from Dashlane to 1Password

    I’m going to cut to the quick with this one. Last week AgileBits, the company behind popular password manager 1Password, rolled out a new subscription-based service and with it, 6 months of 1Password for free. While I have been a big proponent of Dashlane I’ve noticed that the quality of the service has been steadily…

  • |

    If You’re Afraid of Automattic Making $5K Websites, You Need to Change Your Approach

    Recently, WordPress.com/Automattic “entered” the sub-$5,000 website market by announcing a new program, as reported by WordPress Tavern. Naturally, the reaction was mixed, but there seems to be a lot of anger that Automattic would do such a thing, which could potentially kill competition because it’s so big. Here’s the thing: If you think you’re competing with Automattic for sub-$5,000 websites, you need to change your approach.

  • | |

    Mobile Matters! Google to change Search Rankings

    If you’ve done a Google Search on your mobile device recently, you may have noticed that Google adds a bit of text in the search results alerting you to the fact that a website is (or is not) mobile friendly. This can have a big impact on your website’s search ranking.

  • | |

    Directory Handler at Theme Forest

    Note: This article was published while I was in my early 20s. I was much younger and dumber. Please don’t hold it against me. One of the perils of having a 20+ year old website!I’m happy to announce my first Theme Forest component, Directory Handler. it’s a simple set of 2 classes that handle (in…

  • |

    Web Based Password Manager

    I would love a web based password manager that’s completely accessible on all of my devices. I know that there are a lot of tools out there already, and I know there are some inherent security risks with this approach, but here is what I’m thinking: It simply stores Title, URL, Username, Password, and maybe a notes…