Layer Genie Support Product Page
This topic is locked
This topic was archived
Rollover buttons
Asked 04 Aug 2003 01:17:07
1
has this question
04 Aug 2003 01:17:07 cyn breon posted:
Hi,How can I make the original rollover stay on the alternate image while the menu is visible?
thanks
cyn
Replies
Replied 14 Aug 2003 19:56:59
14 Aug 2003 19:56:59 Marja Ribbers-de Vroed replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>How can I make the original rollover stay on the alternate image while the menu is visible?<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Layer Genie can not do that out of the box, but with some creativity it can be done because Layer Genie does have a (new) feature that comes in handy for things like this: it has 2 built in "hooks" to do additional things once a (menu) layer is shown or hidden:
<ul>
<li>If the page has a JS function named onLGShow(), then that function will be called each time Layer Genie is used to show a (menu) layer.</li>
<li>Similarly, if the page has a JS function named onLGHide(), then that function will be called each time Layer Genie is used to hide a (menu) layer.</li>
</ul>
Both onLGShow() and onLGHide() receive the name of the layer that is being shown/hidden as an argument, so you can choose to do something regardless of the specific layer shown/hidden or you can do something depending on the value of the passed layer name.
I've built a little demo to show you the idea, but you will have to be creative and modify it to suit your specific needs. The demo can be found here: www.ribbers-zeewolde.nl/demo/layergenie/rollover.html
Here's what I did in that demo to make the rollover's alternate image stay on while the menu layer is visible:
<ul>
<li>I created the rollover button using the standard DW Swap Image behavior, also specifying that the original button image should be restored when mousing off the button</li>
<li>then I applied the Show Layer Genie behavior to the rollover button</li>
<li>then I created the onLGHide() function and moved the MM_swapImgRestore() call from the onMouseOut event of the button image to that new function.</li>
</ul>
I hope this helps. Let me know if you need further assistance.
Regards,
--
Marja Ribbers-de Vroed
www.flevooware.nl
www.flevooware.nl/dreamweaver/
Edited by - MarjaR on 14 Aug 2003 19:57:48
Edited by - MarjaR on 14 Aug 2003 19:59:51
Layer Genie can not do that out of the box, but with some creativity it can be done because Layer Genie does have a (new) feature that comes in handy for things like this: it has 2 built in "hooks" to do additional things once a (menu) layer is shown or hidden:
<ul>
<li>If the page has a JS function named onLGShow(), then that function will be called each time Layer Genie is used to show a (menu) layer.</li>
<li>Similarly, if the page has a JS function named onLGHide(), then that function will be called each time Layer Genie is used to hide a (menu) layer.</li>
</ul>
Both onLGShow() and onLGHide() receive the name of the layer that is being shown/hidden as an argument, so you can choose to do something regardless of the specific layer shown/hidden or you can do something depending on the value of the passed layer name.
I've built a little demo to show you the idea, but you will have to be creative and modify it to suit your specific needs. The demo can be found here: www.ribbers-zeewolde.nl/demo/layergenie/rollover.html
Here's what I did in that demo to make the rollover's alternate image stay on while the menu layer is visible:
<ul>
<li>I created the rollover button using the standard DW Swap Image behavior, also specifying that the original button image should be restored when mousing off the button</li>
<li>then I applied the Show Layer Genie behavior to the rollover button</li>
<li>then I created the onLGHide() function and moved the MM_swapImgRestore() call from the onMouseOut event of the button image to that new function.</li>
</ul>
I hope this helps. Let me know if you need further assistance.
Regards,
--
Marja Ribbers-de Vroed
www.flevooware.nl
www.flevooware.nl/dreamweaver/
Edited by - MarjaR on 14 Aug 2003 19:57:48
Edited by - MarjaR on 14 Aug 2003 19:59:51