Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Caltech homepage trick

  1. Aug 26, 2004 #1


    User Avatar
    Gold Member

    I'm designing my first website and I found something I want to do, but don't know how to do it.
    On www.caltech.edu, clicking a section of the navigation bar (ex. About Caltech) opens a sub menu (of links) without reloading the page. This is what I want to do. I've been searching for hours with no luck. From what I've gathered, this can maybe be done with
    DHTML- floating layers and turning visibility on/off or
    Javascript and imbedded images or
    But I have no idea what any of those involves. Er, did I mention I'm still learning? :redface:
    I just want to know how they did it- or how it can be done. If someone can point me in the right direction, I can learn the rest. I found the guy who created the page, but I really don't want to bother him- so I'm bothering you guys & gals instead :biggrin: Many thanks.
    Happy thoughts
  2. jcsd
  3. Aug 26, 2004 #2
    Have you tried to
    Right click -> view source

    if you see any .js file reference download that too!
  4. Aug 26, 2004 #3


    User Avatar
    Staff Emeritus

    There are a couple of ways to go about this:

    1. Use Frames - This is the easy way, but can get messy to manage.
    2. Javascript and DOM (Document Object Model) - This is more difficult but easier to manage.

    If you use windows you might have encountered the registry. Basically when your browser downloads an html file it parses the keywords and puts in a registry(tree) type format. You can go to START->RUN and type regedit to see the registry.

    Each node can have a parent, children or siblings. Once you get down to the lowest level of the tree structure you'll find that the nodes have keys with values. When the browser draws a webpage it is constantly reading from the tree and updating based on what is there.

    One of the things you can do with javascript is replace, delete or add nodes in the tree. By doing this you can modify portions of the website on the fly without downloading a new html file and then refreshing the whole page.


    http://www.w3schools.com/htmldom/default.asp [Broken]
    http://www.mozilla.org/docs/dom/domref/dom_shortIX.html [Broken]
    Last edited by a moderator: May 1, 2017
  5. Aug 27, 2004 #4


    User Avatar
    Gold Member

    Yes, I can tell they use JS. Thanks again.
    I can't help but wonder why more people aren't using this??
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook