Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Flyout Menu JavaScript

Status
Not open for further replies.
May 12, 2002
51
US
I'm having trouble with this script. You can see it in action at It's on the left hand side. Where it says "Product Families"..."Windows"..."Office"...etc. When you hover over those links, the cell background changes color and a border appears around the cell. However, on the Microsoft site, the links open in the dame (parent) window. I need them to open up in a pop-up window, with my specifications for each link on my site. Some windows need to open bigger than others, some need to show the toolbar, some don't...well, you get the idea.

I have been trying to figure this out for WEEKS.

Could someone please take a look and help?

Page with script is located here:

JavaScript files used:

I belive I would have to edit the .htc file, but not sure. Maybe it goes in the HTML.

Help!
Thanks!
-JusTin
 
Call a javascript function from the link using either onclick="... or href="javascript:...
Your function can then determine which parameters to use to open the window and what url to use. You can either pass in some type of ID to identify the window parameters or just pass them in as a string. For example:
<script language=javascript>

function openWindow(winID,winURL)
{
var winParams = &quot;&quot;;
if (winID==1) {winParams=&quot;...&quot;}
else if (winID==2) {winParams=&quot;...&quot;}
else if (winID==3) {winParams=&quot;...&quot;}
window.open(winURL,&quot;&quot;,winParams);
}
</script>
<a href=&quot;#&quot; onclick=&quot;openWindow(1,'myurl.htm'); return false&quot;>some page</a>
<a href=&quot;#&quot; onclick=&quot;openWindow(2,'myurl2.htm'); return false&quot;>some page 2</a>
<a href=&quot;#&quot; onclick=&quot;openWindow(3,'myurl.htm'); return false&quot;>some page 3</a>

rest of your HTML...
 
This works, however, it puts a &quot;#&quot; at the end of my site address in the users address bar. IF the user hits refresh, after they click on one of these links, the link turns white and becomes un-clickable. If I delete the # from the address bar, and then refresh, everything works OK. I belive it has something to do with the default.htc file that goes with this script. IT has a TON of code in it, and I belive somewhere in there is some code that is casuing the pop up window script not to work correctly.. help! :) The default.htc file is here:
THANKS! Thanks!
-JusTin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top