Re: display different elements in transparent areas based on z-index values

Hi, morphex-

Morph Ex wrote (on 3/7/09 5:02 PM):
>
> I have a suggestion for a new svg feature and would like to get a few
> opinions on whether it would even be possible.  I've recently been
> looking for a way to display different backgrounds/elements through
> different transparent areas of svg and png images.  As an example,
> imagine that you have a svg image containing 3 different transparent
> areas.  This image is going to be positioned on top of multiple
> elements in a web page.  Let's say that it's displayed on top of a
> div element which is on top of another div element which is on top of
> the body element.  Each of those elements contain a different
> background and a different z-index value.  Would it be possible to
> assign a z-index value to each transparent area in the image?  That
> way the transparent area would display the element located behind the
> image at the specified z-index value.  If no element was found behind
> the image at that z-index then the transparent area would simply
> revert to the default behavior.  Currently the transparent areas in
> an image will only display the element directly behind them.  By
> adding this feature you could have multiple elements stacked on top
> of each other and display a different one in each transparent area of
> the image.  Would this feature be possible in svg?  If it is possible
> then how or where can I suggest that it be implemented in a future
> svg specification?

Currently, SVG does not have any z-index properties (though we are 
considering something similar for use with pseudo-3D transforms). 
Therefore, we don't have any such functionality as you describe.

I don't immediately see any application for such a feature, but I may be 
overlooking something... can you give us some examples where this might 
be useful?  Note that SVG does allow you to change opacity and provide 
clipping paths or masks in a shape, so you might be able to use some 
combination of those features along with scripting and 'display:none' to 
get the desired effect, without having to have a special feature in the 
language for it.  As a rule, specifications try to cover the most 
general use cases.

Regards-
-Doug Schepers
W3C Team Contact, SVG and WebApps WGs

Received on Monday, 9 March 2009 05:28:57 UTC