PDA

View Full Version : Pop Up Links in Scrollable Menu Links



masterAJC
11-24-2005, 08:36 PM
Script: Scrollable Menu Links
http://www.dynamicdrive.com/dynamicindex1/scrollerlink.htm

I am trying to edit this script so that when clicked a link will open in a new (pop up) window. In the end, I want this pop-up window to be "chromeless" (no address bar, scroll bar, menu...). So far, I've been terribly unsuccessful. Im fairly new to Javascript, and HTML for that matter, so I'll thank you in advance for your help and patients.

Please, let me know if I should provide any more information on this code or my page...

jscheuer1
11-26-2005, 02:54 PM
You can add in something like this (as I have for the second link, highlighted red) to the configured link(s) for those you want to have this treatment (from the demo):


var menucontents='<nobr><a href="http://www.dynamicdrive.com">Dynamic Drive</a> | <a href="http://www.javascriptkit.com" onclick="window.open(this.href,\'\',\'width=600, height=400\');return false;">JavaScript Kit</a> | <a href="http://www.codingforums.com">CodingForums.com</a> | <a href="http://www.builder.com">Builder.com</a> | <a href="http://freewarejava.com">Freewarejava.com</a></nobr>'

nfgkid
05-06-2006, 10:47 PM
How can I get the pop up window to show the scroll bar? Thanks to whomever helps!

jscheuer1
05-07-2006, 03:07 AM
How can I get the pop up window to show the scroll bar? Thanks to whomever helps!

Working from my above example, add into the specifications' section:


onclick="window.open(this.href,\'\',\'width=600, height=400, scrollbars=1\');return false;"

For a fairly good listing of most of what can be done with this method, see HTML DOM open() Method (http://www.w3schools.com/htmldom/met_win_open.asp) at the w3schools. Just remember that in this particular case, we are escaping with a down slash (\) all single quotes ('). This is because the above was originally a part of a string that was itself enclosed in single quotes:


var menucontents='<nobr><a href="htt . . . m</a></nobr>'

In general usage, this is not required and probably will cause an error.

nfgkid
05-07-2006, 03:26 AM
Thanks! Worked like a charm. This forum is so freakin' rad. I always find what I'm looking for. :D