Image layering with checkbox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matthew White

    #1

    Image layering with checkbox

    Hi -

    From a Javascript beginner:

    I'd like to display an image in a table cell, and in another cell have 3 or
    4 checkboxes. Based on the boxes check, I would "overlay" images on top of
    the original image in the other table cell.

    Thanks....


  • Matthew White

    #2
    Re: Image layering with checkbox

    Here is my code (that is not working):

    <html>
    <head>
    <script type="text/javascript">
    function check()
    {
    if (check1.checked )
    {
    div1.style.zInd ex=2;
    }
    if (check2.checked )
    {
    div2.style.zInd ex=2;
    }
    </script>

    </head>
    <body>

    <div name="base" style=position: absolute;left:2 00;top:0;z-index:1>
    <img src="baseimage. jpg" height=639 width=639>
    </div>

    <div name="div1"styl e=position:abso lute;left:200;t op:0;z-index:0>
    <img src="overlayima ge1.jpg" height=639 width=639>
    </div>

    <div name="div2"styl e=position:abso lute;left:200;t op:0;z-index:0>
    <img src="overlayima ge2.jpg" height=639 width=639>
    </div>

    <form><input type=checkbox name="check1" value="Overlay 1" >Overlay 1
    <br><input type=checkbox name="check2" value="Overlay 2" >Overlay 2
    <br><input type="button" name="test" onclick="check( )" value="View"></form>
    </body>
    </html>



    Comment

    Working...