-
Opening a link in a JS dropdown menu in a new browser window
Call me crazy but, I'm a designer, so this is all greek to me - I how to do basics, but cant wrap my artsy fartys brain around this one.
I have a working javascript dropdown menu, I can get it to link the page that I want, but I would like the page to open in a new browser window. I've tried adding basic HTML things like:
"target=_new"
"target=_blank"
target="_new"
target="_blank"
;_blank
:_new
--- Nothing worked.
So, I read the directions in the JS document-
but cannot get it to work - any help would be greatly appreciated.
Code:
3---Unique sub menu item URL targets may be defined with the
following parameter option. Allowable 'DQM_urltargetX' param values
include... _self, _parent, _new, or "my frame name".
DQM_urltargetX = "_new" :shock: :shock:
The link is -- I just want this silly PDF to open in its own window:
Code:
DQM_url1_5 = "2007-08-27_TermsCond.pdf"
Code:
DQM_sub_xy1 = "-83,30"
DQM_sub_menu_width1 = 150
DQM_subdesc1_0 = "About"
DQM_subdesc1_1 = "History"
DQM_subdesc1_2= "Diversity"
DQM_subdesc1_3 = "Commitment"
DQM_subdesc1_4 = "Global "
DQM_subdesc1_5 = "Supplier Terms & Conditions"
//DQM_icon_index1_0 = 0
//DQM_icon_index1_1 = 0
//DQM_icon_index1_2 = 0
//DQM_icon_index1_3 = 0
//DQM_2nd_icon_index1_0 = 0
//DQM_2nd_icon_index1_1 = 0
DQM_url1_0 = "about.html"
DQM_url1_1 = "history.html"
DQM_url1_2 = "diversity.html"
DQM_url1_3 = "commitment.html"
DQM_url1_4 = "global.html"
DQM_url1_5 = "2007-08-27_TermsCond.pdf"
Thanks in advance
Shocked [/code][/quote]
-
Now listen heah!
is this an HTML drop down?
and just to clarify.. you only want the PDF to open in a new window.. not the other links correct?
-
HTML - Ok, learned something new -
Yes, just want the PDF to open in a new window.
I've tried:
<a href="http://www.website.com/" target="_blank">
a href="http://www.website.com/" target="_blank"
"http://www.website.com/" target="_blank"
and didn't work
-
Now listen heah!
try this maybe. it worked for me in firefox and IE on the mac.
Code:
<html>
<head>
<title>pop menu quickie</title>
<script language="javascript">
function get_link(link) {
var linkage = new Array();
linkage = link.split("|");
if(linkage[1] == "_self") {
window.location = linkage[0];
} else {
window.open(linkage[0]);
}
}
</script>
</head>
<body>
<form name='linker' action='' method='post'>
SELECT FROM THE MENU TO GO TO PAGES
<select name='linkpop' onChange='get_link(this.options[this.selectedIndex].value)'>
<option value='link1.html|_self'>link 1</option>
<option value='link2.pdf|_blank'>PDF Document</option>
</select>
</form>
</body>
</html>
If you can see in the code where the select statement is.. in the options you can see I divided the value into two parts.. the first is the actual link, the second is the target.
<option value='link1.html|_self'>Link 1</option>
for your code it would look like this
<option value='about.html|_self'>About</option>
and the PDF would look like this
<option value='2007-08-27_TermsCond.pdf|_blank'>Supplier Terms & Conditions</option>
i uploaded the quick example to my site. the links don't go anywhwere, but you can see that one opens in the same window.. and the other opens in a new window. http://mac8mypc.100wd.net/mac8_filez/pop_menu.html
i hope that helps
-
-
Thank you for help.
Unfortunatlly, your script works, but not when added the existing on
The code for link:
DQM_url1_5 = "2007-08-27_TermsCond.pdf"
There has be something easier, that being overlooked. I'm assuming that s/t needs to be done to the or the
Code:
"2007-08-27_TermsCond.pdf"
of the link.
There is one file for the menu 'menu.js' which is applied to the entire site -
hmmmmmmmmmmmmmmmmm
-
Now listen heah!
i see.. you're modifying some other script. I tried to make my code as simple as i could so you could just use it instead of the other thing.. I didn't catch it earlier, but you're probably using some dynamic drop down menu system for your navigation?
if you wanted to give me a link i could look at it.
-
Example
Posted a a page with the drop down navigation:
http://khaus.com/dropdown/
The link I'm trying to get to open in a new browser is:
About Us> Supplier Terms & Conditions
At the bottom of the page I've created a basic HTML link that opens exactly how I'm trying to get the dropdown link to do.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|