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

Using table or Layer (DIV)?

Hi

I am trying to create an interactive links. I am not sure if I should
use table or Layer (DIV) to display picture or text within either a
table cell or a Layer.

If I click on link A, it would display an image or text in a window.
Click on link B and a new image is displayed, replacing the previous
image/text. All this is done without loading a new page.

Note I don't want to use frames, and my host doesn't support
database/php. Can I do this using JavaScript to these links?

Thanks,

Dan
Jul 23 '05 #1
3 1601
In article <40******@dnews.tpgi.com.au>, ph****@hotmail.com enlightened
us with...
Hi

I am trying to create an interactive links. I am not sure if I should
use table or Layer (DIV) to display picture or text within either a
table cell or a Layer.

If I click on link A, it would display an image or text in a window.
Click on link B and a new image is displayed, replacing the previous
image/text. All this is done without loading a new page.

You need to support older browsers, or just the more recent ones like
IE5+, netscape 6+, and Opera 6+?
If supporting NN4, you'll need a special layer tag, otherwise, just use
whatever you want, because you can change the src attribute of an image
with JS.

--
--
~kaeli~
Can you be a closet claustrophobic?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
kaeli wrote:
In article <40******@dnews.tpgi.com.au>, ph****@hotmail.com enlightened
us with...
Hi

I am trying to create an interactive links. I am not sure if I should
use table or Layer (DIV) to display picture or text within either a
table cell or a Layer.

If I click on link A, it would display an image or text in a window.
Click on link B and a new image is displayed, replacing the previous
image/text. All this is done without loading a new page.


You need to support older browsers, or just the more recent ones like
IE5+, netscape 6+, and Opera 6+?
If supporting NN4, you'll need a special layer tag, otherwise, just use
whatever you want, because you can change the src attribute of an image
with JS.


I am not very good with JavaScript. How would you do it?
Jul 23 '05 #3
In article <40******@dnews.tpgi.com.au>, ph****@hotmail.com enlightened
us with...
kaeli wrote:
In article <40******@dnews.tpgi.com.au>, ph****@hotmail.com enlightened
us with...
Hi

I am trying to create an interactive links. I am not sure if I should
use table or Layer (DIV) to display picture or text within either a
table cell or a Layer.

If I click on link A, it would display an image or text in a window.
Click on link B and a new image is displayed, replacing the previous
image/text. All this is done without loading a new page.


You need to support older browsers, or just the more recent ones like
IE5+, netscape 6+, and Opera 6+?
If supporting NN4, you'll need a special layer tag, otherwise, just use
whatever you want, because you can change the src attribute of an image
with JS.


I am not very good with JavaScript. How would you do it?


How would *I* do it?

Tested in IE6, NN7, and Opera 7. Won't work in NN4. Dunno about Safari,
or IE Mac or other browsers, but it shouldn't kill anything.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title> test image switch </title>
<script type="text/javascript">
var imgArray = new Array("tri.gif","tridown.gif","trileft.gif");
function switchIt(num)
{
if (document.images)
{
document.images["img_1"].src=imgArray[num];
}
}
</script>
</head>

<body>
<p>Click on the links to see the pics.</p>
<p>
<a href="#" onClick="switchIt(0);return false;">default (0)</a><br>
<a href="#" onClick="switchIt(1);return false;">one</a><br>
<a href="#" onClick="switchIt(2);return false;">two</a><br>
</p>
<div>
Image will appear here.<br>
<img src="tri.gif" id="img_1" name="img_1">
</div>
</body>
</html>

Note: if you want to do text instead of images, it's quite a bit
different.

--
--
~kaeli~
Experience is something you don't get until just after you
need it.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4

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

Similar topics

10
by: John | last post by:
I have a table with two rows. On the first row is a text box and in the second row is an image. I have set the table cellpadding to 0 and cellspacing to 0. The table is leaving extra spaces in the...
1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
23
by: MattB | last post by:
Hello please help, I have a table cell with a div in it. The div has a width of 300px. but when it is rendered it puts extra space into the table cell. Here's the style <style>...
1
by: Wilhelm Kutting | last post by:
Hi i like to make a complex layout with css. All the content is inside a container div. I like to get the following sequence without the css-layout: logo title mainnav content i can only...
1
by: Chris McGarry | last post by:
Hello, I'm new to style sheets and have been fighting with browser compatibility for two days. I'm developing a image selection page (similar to Ebay where the visitor can select and enlarge 1-6...
2
by: Locoboy | last post by:
Is it possible to hide certain DIVlayers when the user has clicked a link? using PHP? (it's possible by using javascript, but i want to avoid using JS) So it has to be something like: 1. if...
7
by: petethebloke | last post by:
Can anyone help? I have a client who has made a "dynamic interactive map" of our city using Dreamweaver. Each map file has hotspots that pop-up a div with a little image when the mouse goes over...
3
by: kksandeep | last post by:
i am using this three files to uplod file. i got this file from net but i think these have some error. i am new to this field plz help the script i found is some helpful but not too that i need ...
4
by: ettarameshreddy | last post by:
hi i got a problem like this. i write an anchor tag like this <a href="" onclick="layer()">Click to see this layer</a> and written a DIV tag like this <div id="layer"...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.