PDA

View Full Version : Popup sublink in dhtml menu


Reno CF
01-23-2003, 02:48 PM
I would like to incorporate a "Pop-it menu" script into a page. The config is pretty straightforward, and I have it working exactly as I want, except for one thing -- I'd like one of the sublinks to launch a small popup window.

The popup window code I want to use is:

onclick="return openInfo('HTML/pageaddress.html');" href="pageaddress.html">
And I need to place that code in the "popit menu" at this location in the script:

linkset[1]+='<div class="menuitems"><A HREF="-------.html">Page Address</A></div>'

So the question is: How do I replace <A HREF="-------.html"> with the popup onclick, to make it work? Just substituting one for the other brings up all kind of error codes.

Any help is appreciated..........

Mr J
01-26-2003, 05:44 PM
Not sure here but try .....




linkset[1]+='<div class="menuitems"><A HREF="#null" onclick="window.open('yourpage.html')">Page Address</A></div>'


The above is all one line

Reno CF
01-29-2003, 04:43 AM
Thanks Mr J -- that doesn't seem to work in that particular script. When I add that line, I get an error message, and none of the other links (which do not require any popups) will expand as they should. It may very well be that the script does not allow popups. Too bad, as it is a very nice js otherwise...

arnyinc
01-29-2003, 01:25 PM
I'm pretty sure your only problem is mixing the apostrophes and quotation marks which is giving you syntax errors. I just put escape characters (backslashes) in front of the two apostrophes in the onclick event, so that it doesn't think the apostrophes are the end of the line.

linkset[1]+='<div class="menuitems"><A onclick="window.open(-'HTML/pageaddress.html-');" href="pageaddress.html">Page Address</A></div>'

edit: the forum is hiding the backslashes I put in. change the hyphens to backslashes

Reno CF
01-29-2003, 09:38 PM
Thanks arnyinc -- the back slashes did the trick. I appreciate your input and you too Mr J ..... the problems have been solved.....