Page 1 of 1

JavaScript popup from main menu?

Posted: Wed Oct 15, 2008 4:44 pm
by chilsta
I need to add a popup from the main menu which will open a popup using javascript like this guy.

I have to use Javascript because I need to be able define the properties of the new window, which isn't possible using target="_blank".

For accessibility/ usability reasons I'd like to use A List Apart's method (unless there's a better/ easier option?).

What that boils down to is needing to be able to define an ID (or class) for the link:

Code: Select all

	<a id="popup-feat" href="example_popup.html">link</a>
there's then a Javascript event listener which is placed in external .js file.

Any help with this'd be much appreciated.

Re: JavaScript popup from main menu?

Posted: Tue Nov 25, 2008 12:28 pm
by chilsta
Bumping as I've still not found a solution to this- there must be some way of adding an accessible, configurable popup to CMSMS' main menu?

Re: JavaScript popup from main menu?

Posted: Tue Nov 25, 2008 2:19 pm
by Dee
You can define an ID (or class) for the link in your menu template.
For an ID you can use for example id="{$node->alias}"

(see also http://forum.cmsmadesimple.org/index.ph ... #msg134302)

Regards,
D

Re: JavaScript popup from main menu?

Posted: Tue Nov 25, 2008 2:42 pm
by chilsta
Thanks very much Dee-

That looks like exactly what I need.
I'm hoping it will also fix another site I have which validates apart from one small niggle with an ID in the nav being repeated- this should get rid of that.

Will experiment and get back.