473,395 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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....
Jul 20 '05 #1
1 4080
Here is my code (that is not working):

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

</head>
<body>

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

<div name="div1"style=position:absolute;left:200;top:0; z-index:0>
<img src="overlayimage1.jpg" height=639 width=639>
</div>

<div name="div2"style=position:absolute;left:200;top:0; z-index:0>
<img src="overlayimage2.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>

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tobias ?keblom | last post by:
Hi! Hi have a number of transparent png-images that I want to dynamicly be able to combine/merge to one new image. Kind of layering the images so to speak. I have been looking at the JAI-package...
6
by: Weng kin | last post by:
Hi everyone, I have a problem trying to load an image without the image resizing itself to fit into the window. My simple javascript is as follows: function viewImage(filename) { features =...
8
by: al | last post by:
Hi, I've been trying to create a image mouseOver effect using CSS - is this possible? Or will I have to use DIV tags or something along those lines? I've tried a number of things - the code...
2
by: Matt | last post by:
In the following code, I have 2 questions regarding submit button with image. 1) Does this code <input type="image" name="populate" src="populate.gif"> behave the same as an HTML submit button...
7
by: Showjumper | last post by:
Hi, I have developed an upload server controls to be reused over a number of projects. One of the tasks it needs to handle is to rotate an image. I want to accoplish this by checking the checkbox...
2
by: Water Cooler v2 | last post by:
I want to stretch the image so that it fills the entire cell width and height. How do I do that? <TD background="bg.gif" width="100%" height="100%" style="background-repeat: no-repeat;"> So...
6
by: ravis64 | last post by:
Hi, I basicaly have a form of 9 images, spread in a 3 x 3 grid. What i need to do is give each image a border and on some of the borders they need to over lap the image a bit in the bottom corner...
4
by: prashantkuppa | last post by:
Hell all, Here i have i problem i have 2 checkboxs in 2 different gif format images. 1. is checked checkbox gif image 2. is unchecked checkbox gif image so i want to know the status of...
4
by: ameshkin | last post by:
I have a checkbox with an ID of svc_tp_1, and an image that corresponds with this checkbox below it. <input type="checkbox" name="checkbox" id="svc_tp_1" value="svc_tp_1" / <img...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.