473,408 Members | 2,888 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,408 software developers and data experts.

Displaying more than one picture at a time

I'm just trying to test something out to see if I can get it working but I'm a little stuck. I have two frames. The left one has a menu of radio buttons. I want it so when you click on the radio button it will show the picture in the right frame. When you click on a different radio button I want it to show that picture to the right of the other picture that's already there. When you click another radio button I want it to show that picture to the right of the other two and so on. I can only get it to display one picture at a time. Can somebody point me in the right direction? Thanks.

The code is below:

Frame Code:
Expand|Select|Wrap|Line Numbers
  1. <frameset cols="25%,75%"> 
  2.     <frame name="menu" src="buttons.html"   frameborder="1">
  3.     <frame name="contentFrame" src="main.html"   frameborder="1">
  4. </frameset>
Rest of Code
Expand|Select|Wrap|Line Numbers
  1. <form id="image" action="">
  2.   <p>
  3.     <input type="radio" name="imageButtons" value="image1" onclick="javascript:whichimage('image1')" />image 1<br />
  4.     <input type="radio" name="imageButtons" value="image2" onclick="javascript:whichimage('image2')" />image 2<br />
  5.     <input type="radio" name="imageButtons" value="image3" onclick="javascript:whichimage('image3')" />image 3<br />
  6.     <input type="radio" name="imageButtons" value="image4" onclick="javascript:whichimage('image4')" />image 4<br />
  7.     <input type="radio" name="imageButtons" value="image5" onclick="javascript:whichimage('image5')" />image 5<br />
  8.     <input type="radio" name="imageButtons" value="image6" onclick="javascript:whichimage('image6')" />image 6<br />
  9.   </p>
  10. </form>
  11. <script type="text/javascript">
  12. <!--
  13.  
  14. function whichimage(imagename) {
  15.   var image1 = "image1.jpg";
  16.   var image2 = "image2.jpg";
  17.   var image3 = "image3.jpg";
  18.   var image4 = "image4.jpg";
  19.   var image5 = "image5.jpg";
  20.   var image6 = "image6.jpg";
  21.  
  22.   // Get the content frame
  23.  
  24.   var contentFrame = parent.frames["contentFrame"];
  25.  
  26.   if (document.getElementById) {  // W3C Javascript
  27.     switch(imagename) {
  28.       case "image1" : 
  29.         contentFrame.location.href=image1;
  30.         break;
  31.       case "image2" :
  32.         contentFrame.location.href=image2;
  33.         break;
  34.       case "image3" :
  35.         contentFrame.location.href=image3;
  36.         break;
  37.       case "image4" :
  38.         contentFrame.location.href=image4;
  39.         break;
  40.       case "image5" :
  41.         contentFrame.location.href=image5;
  42.         break;
  43.       case "image6" :
  44.         contentFrame.location.href=image6;
  45.         break;
  46.     }
  47.   }
  48.   else {
  49.     alert("Your browser does not appear to support DOM 2");
  50.   }
  51. }
Mar 13 '07 #1
1 1554
acoder
16,027 Expert Mod 8TB
Welcome to TSDN.

Instead of changing the location, just append the img object to the body of that frame or use innerHTML.
Mar 14 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: matthiasjanes | last post by:
Hi, Maybe someone of you can help me. I'm trying to display an image in memory(open file) with an cgi script - but it want work proberly: I'm running an Cgi webserver (CgiServerGui.py). ...
3
by: Nilesh | last post by:
Hi, In my application i need to create the controls at runtime and also need to position them. I am doing it by this like, control.Location = new Point(x,y); Now when i am getting lets say y...
2
by: Lyn | last post by:
Hi, I am struggling to display photographs in a list format. Any help will be greatly appreciated. Originally I had attempted to store photographs as embedded OLE Objects, but had lots of...
14
by: hamil | last post by:
I am trying to display an image in a picture box. The image is a group 4 fax black and white image of a piece of sheet music. The original resolution is 300 X 300 dpi. I want to have the picture...
8
by: Jon Weston | last post by:
I'm setting up an Access2003 database with pictures. I put a bound ole picture ctrl on a form that's source is the table that contains the pictures and follow ALL the directions for embedding a...
1
by: blueheelers | last post by:
I have been researching for several hours on the best way to display images in continous forms in Access 2003. For example, I want to display employee name, email, phone, and picture for each...
4
by: redpears007 | last post by:
Hi Again, Throwing this one out to you again as i am not getting anywhere and can find little to no information out there. I am currently displaying images (Jpegs) in access via the routine...
4
by: shahidrasul | last post by:
i display a pic on picture box and then i want to display another pic after some seconds but problem is that first image is not displaying only display 2nd image 1... display first picture from...
3
by: OldBirdman | last post by:
Each time I move to a different record, I want to display a picture, if available, stored separately from the database. If I have more than one picture, then I will put navagation arrows below the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.