[Chameleon] Re: Chameleon Digest, Vol 20, Issue 14

Paul Spencer pspencer at dmsolutions.ca
Wed Nov 16 13:56:49 EST 2005


Joan,

the problem is not with your code but with the way Chameleon does  
things.  The keymap is actually created outside of your div so hiding  
the div won't do what you expect.  However, I think you can do this:

function hideKeymapDHTML()
{
     CWCDHTML_HideLayer("KeyMapLayerBG");
     CWCDHTML_HideLayer("KeyMapLayerDiv");
     CWCDHTML_HideLayer("zKeyMapBoxTop");
     CWCDHTML_HideLayer("zKeyMapBoxLeft");
     CWCDHTML_HideLayer("zKeyMapBoxBottom");
     CWCDHTML_HideLayer("zKeyMapBoxRight");
     CWCDHTML_HideLayer("zKeyMapBox2Top");
     CWCDHTML_HideLayer("zKeyMapBox2Left");
     CWCDHTML_HideLayer("zKeyMapBox2Bottom");
     CWCDHTML_HideLayer("zKeyMapBox2Right");
}


function showKeymapDHTML()
{
     CWCDHTML_ShowLayer("KeyMapLayerBG");
     CWCDHTML_ShowLayer("KeyMapLayerDiv");
     CWCDHTML_ShowLayer("zKeyMapBoxTop");
     CWCDHTML_ShowLayer("zKeyMapBoxLeft");
     CWCDHTML_ShowLayer("zKeyMapBoxBottom");
     CWCDHTML_ShowLayer("zKeyMapBoxRight");
     CWCDHTML_ShowLayer("zKeyMapBox2Top");
     CWCDHTML_ShowLayer("zKeyMapBox2Left");
     CWCDHTML_ShowLayer("zKeyMapBox2Bottom");
     CWCDHTML_ShowLayer("zKeyMapBox2Right");
}

Cheers

Paul

On 16-Nov-05, at 12:18 PM, joanvp wrote:

> My code is:
>
> ************html code************
> <a href="javascript://" onclick="showhide('mapaguia');">click me</a>
>
> <div id="mapaguia" name="mapaguia">
>     <cwc2 type="KeyMapDHTML" VISIBLE="TRUE" />
> </div>
>
>
> *********css code**************
> #mapaguia {
>   padding:0px;
>   margin:0px;
>   position:absolute;
>   left:39px;
>   top:119px;
>   visibility:hidden;
>   border: 0px none #000000;
> }
>
> ***********javascript**********
> <script language="javascript">
>
> var state = 'hidden';
>
> function showhide(layer_ref) {
>
> if (state == 'visible') {
> state = 'hidden';
> }
> else {
> state = 'visible';
> }
> if (document.all) { //IS IE 4 or 5 (or 6 beta)
> eval( "document.all." + layer_ref + ".style.visibility = state");
> }
> if (document.layers) { //IS NET! SCAPE 4 or below
> document.layers[layer_ref].visibility = state;
> }
> if (document.getElementById && !document.all) {
> maxwell_smart = document.getElementById(layer_ref);
> maxwell_smart.style.visibility = state;
> }
> }
> </script>
>
>
>
> chameleon-request at lists.maptools.org wrote: Send Chameleon mailing  
> list submissions to
> chameleon at lists.maptools.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.maptools.org/mailman/listinfo/chameleon
> or, via email, send a message with subject or body 'help' to
> chameleon-request at lists.maptools.org
>
> You can reach the person managing the list at
> chameleon-owner at lists.maptools.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Chameleon digest..."
>
>
> Today's Topics! :
>
> 1. Show/Hide KeyMapDHTML (joanvp)
> 2. Re: Show/Hide KeyMapDHTML (Jason Fournier)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 16 Nov 2005 08:33:35 -0800 (PST)
> From: joanvp
> Subject: [Chameleon] Show/Hide KeyMapDHTML
> To: chameleon at lists.maptools.org
> Message-ID: <20051116163335.14228.qmail at web50101.mail.yahoo.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi list,
>
> I'm trying to run a javascript function for show and hide  
> KeyMapDHTML with a button. My keymap is positioned throw div tags  
> and css.The function works fine with the div, but keymap is allways  
> on top. Why? how can I hide it without submit the whole page?
>
> Thanks a lot in advanced
>
>
>
> ---------------------------------
> Yahoo! FareChase - Search multiple travel sites in one click.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.maptools.org/pipermail/chameleon/attachments/ 
> 20051116/33266870/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Wed, 16 Nov 2005 11:50:38 -0500
> From: Jason Fournier
> Subject: Re: [Chameleon] Show/Hide KeyMapDHTML
> To: chameleon at lists.maptools.org
> Message-ID: <437B635E.1010509 at dmsolutions.ca>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Joan,
>
> Can you give us your CSS and the snippet of HTML that contains the
> KeyMapDHTML tag?
>
> Thanks,
> Jason
>
>
>
> joanvp wrote:
> > Hi list,
> >
> > I'm trying to run a javascript function for show and hide  
> KeyMapDHTML
> > with a button. My keymap is positioned throw div tags and css.The
> > function works fine with the div, but keymap is allways on top.  
> Why? how
> > can I hide it without submit the whole page?
> >
> > Thanks a lot in advanced
> >
> >  
> ---------------------------------------------------------------------- 
> --
> > Yahoo! FareChase - Search multiple travel sites in one click.
> >
> >
> >
> >
> >  
> ---------------------------------------------------------------------- 
> --
> >
> > _______________________________________________
> > Chameleon mailing list
> > Chameleon at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/chameleon
>
> -- 
> ________________________
> Jason Fournier
>
> DM Solutions Group Inc.
> jfournier at dmsolutions.ca
> www.dmsolutions.ca
> 613.565.5056 x18
>
>
> ------------------------------
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
>
>
> End of Chameleon Digest, Vol 20, Issue 14
> *****************************************
>
>
> Yahoo! FareChase - Search multiple travel sites in one click.
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+






More information about the Chameleon mailing list