473,320 Members | 1,900 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,320 software developers and data experts.

I need a Javascript that can make a div appear and THEN ....

Hi. For my website, I'm trying to develop a JavaScript that makes a div appear. I have found several samples that toggle a div back and forth between visible and hidden, but what I need is a bit different. Here's the scoop: I have a series of thumbnail images. What I'd like to happen is that, when a user clicks, for example, Thumbnail Number 1, an associated div would appear (I've already written the CSS that locates the div). I'd like that div to remain visible UNTIL the user clicks Thumbnail Number 2, at which time I'd like another div (same location as the first, but with different content) to appear. I have 8 Thumbnails in all, and I'd like each of them to behave accordingly. I'd like my user to be able to go to any thumbnail, click it, and have the right div appear ... to be able to move from any thumbnail to any other thumbnail and have the right div appear. One tricky aspect of this is that the previous div would also have to DISappear. If someone can help me achieve that, I'd be very grateful. Ideally, I'd also like to replace the thumbnail image with another image (right in the same place as the first thumbnail; this is more of a typical mouseOver thing; in this case, I'm replacing the plain thumbnail with one that has a drop shadow.) If I can achieve that, too, well … that would be web developer bliss. THANKS.
Apr 19 '07 #1
1 1511
acoder
16,027 Expert Mod 8TB
Keep a global variable which stores the current thumbnail number. Use that to access the currently shown div and hide it when another thumbnail is clicked. I assume that hiding/showing is not a problem. To show the clicked thumbnail div, either pass 'this' or the thumbnail number to the show function which will allow you to access the corresponding div as long as the div has been given the correct id, e.g. div1 for thumbnail 1.
Feb 4 '08 #2

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

Similar topics

7
by: Doug van Vianen | last post by:
I recently found the following JavaScript code which is supposed to let one find then use the ip address of the person accessing the web page containing the script. <SCRIPT...
6
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334,...
5
by: TrvlOrm | last post by:
HI There, I have been struggling with JavaScript code for days now, and this is my last resort! Please help... I am trying to create a JavaScript slide show with links for Next Slide,...
2
by: Pat Scott | last post by:
I am looking for a general purpose javascript snippet that enables me to <div> or <span> HTML to make portions of the form be hidden and then appear. The form contains about 12 sections and some...
1
by: clemenr | last post by:
Hi. I would like to know if the following is feasible in JavaScript. I would create a frameset where the top frame includes JavaScript. The bottom frame would be directed to the login page of an...
7
by: fox | last post by:
Hi, Lacking javascript knowledge, I just realized why my project has a bug. I am using ASP to loop through a set of records while it creates URLs with a querystring that has a single value pair....
8
by: | last post by:
The problem lies here eval("document.TeeForm.amt.value(S+M)"); S and M suppose to add up and the total suppose to appear on the AMT field but it didn't. Any help? ...
43
by: SLH | last post by:
hi people. im trying to validate input received via a text area on an ASP page before writing it to a database. i cant use client side javascript due to policy, so it all has to happen on the...
9
by: Kodiak | last post by:
I am trying to write some javascript code in which you enter some text in one text box and the text will also appear in the second text box. For example, if I write the word "Test" both text boxes...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.