Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

changing layer order/stacking

Hi,

I am trying to change the order of layers i am drawing dynamically.  I want to bring the layer i select to be the top layer (i.e. dynamically change the zindex), and each time i select a different layer that should be the top layer.

Does anyone know how to do this?  (need an example)

Thanx
0
Jyontex
Asked:
Jyontex
1 Solution
 
dorwardCommented:
Untested, but I guess this will work.

<script type="text/javascript">
var z = 1;
function up(el) {
  el.style.zIndex = ++z;
}
</script>

<div onclick="up(this);">foo</div>
0
 
JyontexAuthor Commented:
works.  Thank you.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now