| |

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

  • |

    How to Develop a Website pt. I

    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! Over the summer I did a good amount of web design. I have been developing websites for almost 7 years…

  • |

    Building Web Apps with WordPress

    I just finished reading up a book that was co-written by my friend Jason Coleman called Building Web Apps with WordPress. I picked it up because while I’m generally good at developing themes, I know there were some things I was missing- types of code, optimizations, plugin best practices, etc. I wanted to improve my WordPress…

  • | |

    Freelancers: Generalize Your Code

    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!One thing that was really driven home during my first year of grad school was the importance of reusable code. Not…

  • |

    New Design- Overview

    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!Introduction I suppose if I had to give this version a number, I’d say it’s version 4.0. TheJoey.Net has seen 3…

  • | |

    My First NETTUTS Tut

    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!Web Design tutorial blog NETTUTS published an article I wrote about Building a Facebook Appication Check it out! New post here…

  • |

    Security vs. Usability

    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! A problem that all web developers people in the computer field face is security. When creating your application, website, server,…