| |

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

  • |

    Adding the Media Uploader in WordPress

    …without including the Editor. In the Admin. That was a really long title, so I hope you don’t feel mislead! I was recently working on a project that required a Custom Post Type without the editor, but needed the Media Uploader. Note: This is not a full-blown tutorial. The purpose of this post is to…

  • Uploading Images in PHP

    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!After dabbling in PHP for some time, and writing an image upload script about 8 months ago, I would like to…

  • How To Write An About Page That You’re Proud Of

    The About page is one of the most visited pages on your website. It’s also one of the first pages people visit to see who is behind the site and if it’s worth their time. They want to know you and your site are credible and reliable. In this article, we’re going to look at…

  • | |

    Manifest Development Redesign 2011: Custom Widgets

    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!In Parts 1 and 2, I talked about the two most important parts of the site- the homepage and portfolio. Today…