Log in

View Full Version : Drop down menu w/ description



username
09-03-2005, 05:20 PM
http://www.dynamicdrive.com/dynamicindex1/combodescribe.htm

Can this menu be edited so the links are targeted to a frame, ie main?
If someone can help me, that would be wonderful. :)

jscheuer1
09-03-2005, 07:32 PM
Change this:

function jumptolink(what){
var selectedopt=what.options[what.selectedIndex]
if (document.getElementById && selectedopt.getAttribute("target")=="newwin")
window.open(selectedopt.value)
else
window.location=selectedopt.value
}to:

function jumptolink(what){
var selectedopt=what.options[what.selectedIndex]
if (document.getElementById && selectedopt.getAttribute("target")=="newwin")
window.open(selectedopt.value)
else if (selectedopt.getAttribute("target")==null||selectedopt.getAttribute("target")=='')
window.location=selectedopt.value
else
parent.window[selectedopt.getAttribute("target")].location=selectedopt.value
}Then as in the example where you can use target="newwin", you may now use a frame or iframe name as well. May cause problems in some older browsers.

username
09-03-2005, 07:51 PM
Thanks a bunch! :D