PDA

View Full Version : AnyLink Question



smitsmah
10-07-2006, 09:18 PM
1) Script Title: AnyLink Vertical Menu

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex1/anylinkvertical.htm

3) Describe problem: First, I LOVE your scripts... I find them VERY user friendly. They've helped me complete many a project!

I have a question about the AnyLink menu script. Much like the "Pop-up" question below, I'm trying to assign new window attributes to the menu. This is what I've done so far:

menu1[1]='<a href="http://ymcajags.com" onClick="popup = window.open('http://ymcajags.com','PopupPage','height=600','width=850','scrollbars=yes','resizable=no','status=yes','toolbar=yes','menubar=yes','location=yes','screenX=0','left=0', 'screenY=0','top=0'); return false" target="_blank">Jaguar Football &amp; Cheerleading</a>'

The page does open in a new window but the window size and location seem to get lost in the mix.

Can you offer any suggestions?

Also, if you're not using a <ul> or <li>, but instead placing the <div> tags within individual <td>'s, can you still set the dropdown menu farther from the right side of the main menu?

ddadmin
10-08-2006, 12:10 AM
At a glance I see that the syntax you're using for the window.open() method is incorrect at the end:


menu1[1]='<a href="http://ymcajags.com" onClick="popup = window.open('http://ymcajags.com','PopupPage','height=600, width=850, scrollbars=yes, resizable=no, status=yes, toolbar=yes, menubar=yes, location=yes, screenX=0, left=0, screenY=0, top=0'); return false" target="_blank">Jaguar Football &amp; Cheerleading</a>'

So there should be no individual quotes surrounding each window attribute (ie: location=yes).

Yep, DIV tags should work just as well, since it's a container element with a definable "width".

smitsmah
10-08-2006, 12:33 AM
Thanks much... I'll give it a shot. I wonder if that applies across the board. I use this "pop-up" (new window) script often. It may explain some of the glitches I come across.

Thanks again! You guys write the BEST, most reliable scripts out there and you don't overcomplicate things. I, for one, appreciate that!

DS
TheSmallDetails (.com)

smitsmah
10-08-2006, 01:56 PM
Me again... I didn't have any luck with the new syntax you offered :confused: but I tried this instead and found it will work in IE. I've tried every conceiveable combination (apostrophes, quotation marks, spaces/no spaces) and none of them work in Firefox.

menu1[1]="<a href='http://ymcajags.com' onClick='popup = window.open('http://ymcajags.com','PopupPage','height=600,width=900,scrollbars=yes,resizable=no,status=yes,toolbar=yes,menubar=yes,location=yes,left=0,top=0'); return false' target='_blank'>Jaguar Football &amp; Cheerleading</a>"

I'm not ready to give up yet if you have any other suggestions!

ddadmin
10-09-2006, 11:35 PM
Ah I forgot that any single quotes within your window.open() string should be backslashed. This will work:


menu1[1]='<a href="http://google.com" onClick="popup = window.open(\'http://google.com\',\'PopupPage\',\'height=600, width=850, scrollbars=yes, resizable=no, status=yes, toolbar=yes, menubar=yes, location=yes, screenX=0, left=0, screenY=0, top=0\'); return false" target="_blank">Jaguar Football &amp; Cheerleading</a>'

smitsmah
10-12-2006, 04:18 PM
WONDERFUL... Works like a charm. Thank you SO much!!