PDA

View Full Version : Javascript jumpbox -- How to control numbering?


Delphi123
August 22nd, 2005, 06:18 AM
Dear friends:

I have a solution to a javascript jumpbox issue, but I don't know how to implement it. Here is the problem:

I have a jewelry site at:

http://www.immortalgems.com

Now please click on Catalogue in the top menu, then look for the oval Showcase menu on the left, then click on "Diamond Jewelry". This will bring up a jumpbox at the top left. It works fine. As you can see, if you select Diamonds 05, it will bring up the fifth page of diamond samples. But, look again, even though THE PAGE is correct (it is Diamonds 05, as can be seen both from the content and the page name in the browser URL location box), the menu entry jumps back to "Diamonds 01". Is there a way to modify the original javascript/cgi code to allow the menu entry to say Diamonds 05 so long as you are in page Diamonds 05, then to switch to Diamonds 06 when the page is in Diamonds 06, etc?

It has been suggested to me that I add the following line to the javascript/cgi script:


you could use javascript command like this :

this.selectedIndex = (your index number starting from 0);

Here for the record is the actual javascript/cgi script:


<form method=get action="http://www.immortalgems.com/jumpbox.cgi" onsubmit="location.href=jb.options[jb.selectedIndex].value; return false;">
<select name="jb">
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-01.html">Diamond 01</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-02.html">Diamond 02</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-03.html">Diamond 03</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-04.html">Diamond 04</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-05.html">Diamond 05</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-06.html">Diamond 06</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-07.html">Diamond 07</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-08.html">Diamond 08</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-09.html">Diamond 09</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-10.html">Diamond 10</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-11.html">Diamond 11</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-12.html">Diamond 12</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-13.html">Diamond 13</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-14.html">Diamond 14</option>
<option value="http://www.immortalgems.com/CATALOGUE/Diamond/Diamond-15.html">Diamond 15</option>

</select>
<input type="submit" value="Go">
</form>

Unfortunately, I don't really know javascript. So here are my question: Where precisely do I put the suggested line? And how do I actually complete the line? And do I need to add this line for each line or each page?

Would really appreciate your expert help.

Thank you.

Benjamin