Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Thursday February 8 2018 - 06:02:37

Show popup window with a JavaScript onClick call


Poster: Steel2k6
Dated: Tuesday December 6 2005 - 9:43:24 GMT

Hi!

I would like to show a popup window when I click on a link. For some reason, this does not work. But it works when I call this function on a onMouseOver event for a link. Strange...

So, this works fine:
<a href='#' onMouseOver='popup( "workout",1 );' class='weekCalendarLink' id='entry_1_1'>9:30<br>Workout</a>

This does not work:
<a href='#' onClick='popup( "workout",1 );' class='weekCalendarLink' id='entry_1_1'>9:30<br>Workout</a>

Do you know why or how I could solve this problem? The live page can be found at http://www.get-up-fitness.de/wintercourseplan.aspx .

Thanks!


Poster: Steel2k6
Dated: Tuesday December 6 2005 - 13:41:51 GMT

Milonic team, please help. I saw that this question has been asked a few days ago from another user:

http://forum.milonic.com/viewtopic. ... ight=popup


Poster: Steel2k6
Dated: Tuesday December 6 2005 - 20:53:24 GMT

For everybody who has the same problem and does not want to wait for the answer, this can be used as a workaround:

function initPopup( menuName )
{
setTimeout( "showPopup('" + menuName + "')", 1 );
}
function showPopup( menuName )
{
popup( menuName, 1 );
}

<a href='#' onClick='initPopup( "workout" );' class='weekCalendarLink' id='entry_1_1'>9:30<br>Workout</a>


Poster: Andy
Dated: Wednesday December 7 2005 - 11:03:31 GMT

Hi,

What's happeing is the page is being reloaded because of the href=# bit when you click on the link. The menu is probably showing up but it gets refreshed so you never see it.

You need to replace the href="#" with href="javascript:popup('yourmenu','yourimage')" - This will mean that the link is the javascript popup function executor rather than an actual lnk.

Hope this helps,
Andy


Poster: Steel2k6
Dated: Wednesday December 7 2005 - 21:39:02 GMT

Hi Andy,

thank you very much, this works great!