[Chameleon] Help with DHTML Layers
Jason Fournier
jfournier at dmsolutions.ca
Fri Jun 24 16:13:07 EDT 2005
Abe,
If I understand correctly one way to approach this is to:
1) create a DHTML layer using CWCDHTML_CreateLayer and set its contents to ''
2) document.createElement an iframe into the DHTML layer through appendChild (I don't believe a div itself can have a src)
3) control the position and visibility through javascript via the style object
So, let's assume you've created a div where id="myDiv" using CWCDHTML_CreateLayer. You could then write the following javascript:
var d = document.createElement('iframe');
d.src = 'http://www.google.ca';
var c = document.getElementById('myDiv');
c.appendChild(d);
now, you can control the layer properties through it's style object:
c.style.left = '100px';
c.style.top = '100px';
c.style.visibility = 'hidden';
and so on...
This is one method of creating client-side elements and manipulating them.
Best Regards,
Jason
Abe Gillespie wrote:
> With the currently existing JS APIs, is there a way to create a
> dynamic layer (an HTML one in this case, *not* a GIS layer) whose
> content is not static. I.e. I need to be able to set the layer's src
> to a webpage. All my requirements are as follows:
>
> 1. Layer's visibility is changeable.
> 2. Layer's position is changeable.
> 3. Layer's src can be set to a web page.
>
> If anyone can help I'd very much appreciate it.
>
> Thanks.
> -Abe
>
> _______________________________________________
> 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
More information about the Chameleon
mailing list