473,785 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4112
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>

Jul 20 '05 #2

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

Similar topics

1
6760
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 but I do not find the solution to my problem. thanks in advance. Tobias
6
8106
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 = "height=500, width=670, scrollbars=yes, resizable=yes"; photo = window.open(filename, "Preview", features); }
8
78171
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 below will work for the border no problem, but I can't seem to get the SRC to work - is this not an option in CSS?
2
3508
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 with image populate.gif? When I click p1 or p2 button, it will post the page to process.asp. 2) When I check the checkbox, I want the image in submit button change from populate.gif to validate.gif. Unfortunately, the code InputForm.p2.src =...
7
2459
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 that is next to the file field. Once i browse for the file, i check the box to rotate and then upload. However i am unable to get it to rotate when the box is checked. It only rotates when i set a boolean (RotateImage) to true. Any ideas on how to...
2
17013
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 far I have done that but it doesn't seem to work. I think the height and width get applied to the cell instead of the image. Is there a way around this?
6
1516
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 with the word "NEW". So i was wondering in c# .net windows forms is there a way of layering, like one layer of buttons and a layer on top of borders (so that the border can slighlty overlap the button). Is this possible? What is the best way to do...
4
1831
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 images either checkbox is checked or unchecked . so how can i know please give a clue to go further
4
6164
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 src="images/screen_print.jpg" onclick="toggle('svc_tp_1'); return true;" /> I know how to get the checkbox to check when the image is clicked, but what I really want is a toggle. When a user clicks on the image, the system should first check to see if svc_tp_1...
0
9483
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10346
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9956
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8982
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.