Learn How to Create Caltech Homepage Style Navigation

  • Thread starter Thread starter honestrosewater
  • Start date Start date
  • Tags Tags
    caltech
Click For Summary
To create a website feature similar to the navigation bar on www.caltech.edu, which opens a submenu without reloading the page, you can utilize JavaScript and the Document Object Model (DOM). This approach allows for dynamic content updates by manipulating the HTML structure directly through JavaScript, enabling elements to be shown or hidden without requiring a full page refresh. While using frames is an easier method, it can lead to management issues. Learning resources such as W3Schools and Mozilla's documentation on JavaScript and the DOM are recommended for gaining a deeper understanding of these techniques. The use of JavaScript for such features is not as widespread as it could be, despite its effectiveness.
honestrosewater
Gold Member
Messages
2,133
Reaction score
6
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
iframe.
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
Rachel
 
Computer science news on Phys.org
Have you tried to
Right click -> view source

if you see any .js file reference download that too!
 
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.

Resources:

http://www.w3schools.com/js/default.asp
http://www.w3schools.com/htmldom/default.asp
http://www.mozilla.org/docs/dom/domref/dom_shortIX.html
 
Last edited by a moderator:
Yes, I can tell they use JS. Thanks again.
I can't help but wonder why more people aren't using this??
 
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...

Similar threads

  • · Replies 8 ·
Replies
8
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
7
Views
3K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 22 ·
Replies
22
Views
2K
Replies
7
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 5 ·
Replies
5
Views
7K
  • · Replies 5 ·
Replies
5
Views
2K