Permlink Replies: 3 - Pages: 1 - Last Post: 04-Jul-2003 22:05 Last Post By: davidekholm
davidekholm

Posts: 3,455
Registered: 18-Oct-2002
Create a drop-down navigation list
Posted: 29-Apr-2003 08:25
  Click to reply to this thread Reply
Put the following code inside a slide.htt page in order to have quick navigation between pages using a drop-down navigation box. First we define a practical function that builds the <option> tags for the "select" component:
<%
  /* Generate drop box options for quick navigation */
  String addLinks() {
    StringBuffer buf = new StringBuffer();
    for (int i=0; i<files.length; i++) {
      if (files[i].isDirectory()) continue;
      String base = files[i].getName();
      int lastDot = base.lastIndexOf('.');
      if (lastDot != -1) base = base.substring(0,lastDot);
      buf.append("<option");
      if (i == imageNum-1) buf.append(" selected");
      buf.append(" value=\"" + base+".html" + "\">" + base);
    }
    return buf.toString();
 
  }
%>

Now it's easy to generate the navigation list:
<form>
  <select onChange="window.location.href = this.options\[this.selectedIndex].value">
    <%= addLinks() %>
  </select>
</form>
Dave
Re: Create a drop-down navigation list
Posted: 25-Jun-2003 05:15   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Hello,

When I put this code into my Slide.htt It does make a pull down navigation menu but only to other pictues. How can I modify it to navigate to other index pages?
stef

Posts: 1
Registered: 17-Jun-2003
Re: Create a drop-down navigation list
Posted: 25-Jun-2003 19:36   in response to: Dave in response to: Dave
  Click to reply to this thread Reply
It looks a bit like my problem:
"insert links to brother/sister pages"

I've solved that problem now,
but unfortuantly I wasn't able to do it in Java,
I had to make an executable program,
so it only works in M$ ;-((

I have to clean up the programcode a bit, write some documentation, make an example album and then I'll publish it. Maybe today, maybe this week...

Stef Mientki
davidekholm

Posts: 3,455
Registered: 18-Oct-2002
Re: Create a drop-down navigation list
Posted: 04-Jul-2003 22:05   in response to: Dave in response to: Dave
  Click to reply to this thread Reply
Please copy code from the source code for the Exhibit skin as that skin has a drop down list to go between index pages.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums