keber
01-20-2001, 08:42 PM
Hi!
I would like some help at Javascript programming. I'm working on a page 'glossary of terms' (cca. 240 terms). It looks so: In left frame there's a description of term in the right there is/are corresponding picture(s). Pictures are not to be loaded all of them if there are more pictures related to a term. So I made a script which makes ONLY picture change if clicked on a corresponding link (under or over picture in the same frame). Page remains the same. However I would like a short description of a picture currently shown, which would change in a relation with the picture currently shown (means changing picture AND description at the same time -> at clicking corresponding link). I don't want to use textfields because they can't be graphically well designed.
Changing of pictures works well, I wonder only if someone knows, how to change description under picture with clicking on the same link WITHOUT changing whole page. Current HTML code is below.
Thank you.
keber
HTML code:
<html>
<head>
<title>slike</title>
</head>
<body bgcolor="#000000">
<SCRIPT LANGUAGE="Javascript">
//definitions
var pict1 = 'pictures/chaos_1.jpg';
var descript1 = 'Picture 1: description';
var pict2 = 'pictures/catena_1.jpg';
var descript2 = 'Picture 2: description';
var pict3 = 'pictures/chasma_1.jpg';
var descript3 = 'Picture 3: description';
function picture1() { // function that shows picture 1 and description 1 AT THE SAME TIME
document.show.src = pict1;
document.atts.write = descript1; // ???
}
function picture2() {
document.show.src = pict2;
document.descr.src = descript2; // ???
}
function picture3() {
document.show.src = slika3;
document.atts.src = descript3; // ???
}
</SCRIPT>
<!-- picture which depends on link clicked below -->
<img src="pictures/catena_1.jpg" alt="chaos" width="230" height="230" hspace="0" vspace="0" border="0" align="top" name="show">
<p>
<span name="atts" id="atts">description</span> <!-- only trying -->
<p>
<!--links that trigger functions-->
<a href="javascript:picture1()">picture 1</a>, <a href="javascript:picture2()">picture 2</a>, <a href="javascript:picture3()">picture 3</a>
</body>
</html>
[This message has been edited by keber (edited January 20, 2001).]
I would like some help at Javascript programming. I'm working on a page 'glossary of terms' (cca. 240 terms). It looks so: In left frame there's a description of term in the right there is/are corresponding picture(s). Pictures are not to be loaded all of them if there are more pictures related to a term. So I made a script which makes ONLY picture change if clicked on a corresponding link (under or over picture in the same frame). Page remains the same. However I would like a short description of a picture currently shown, which would change in a relation with the picture currently shown (means changing picture AND description at the same time -> at clicking corresponding link). I don't want to use textfields because they can't be graphically well designed.
Changing of pictures works well, I wonder only if someone knows, how to change description under picture with clicking on the same link WITHOUT changing whole page. Current HTML code is below.
Thank you.
keber
HTML code:
<html>
<head>
<title>slike</title>
</head>
<body bgcolor="#000000">
<SCRIPT LANGUAGE="Javascript">
//definitions
var pict1 = 'pictures/chaos_1.jpg';
var descript1 = 'Picture 1: description';
var pict2 = 'pictures/catena_1.jpg';
var descript2 = 'Picture 2: description';
var pict3 = 'pictures/chasma_1.jpg';
var descript3 = 'Picture 3: description';
function picture1() { // function that shows picture 1 and description 1 AT THE SAME TIME
document.show.src = pict1;
document.atts.write = descript1; // ???
}
function picture2() {
document.show.src = pict2;
document.descr.src = descript2; // ???
}
function picture3() {
document.show.src = slika3;
document.atts.src = descript3; // ???
}
</SCRIPT>
<!-- picture which depends on link clicked below -->
<img src="pictures/catena_1.jpg" alt="chaos" width="230" height="230" hspace="0" vspace="0" border="0" align="top" name="show">
<p>
<span name="atts" id="atts">description</span> <!-- only trying -->
<p>
<!--links that trigger functions-->
<a href="javascript:picture1()">picture 1</a>, <a href="javascript:picture2()">picture 2</a>, <a href="javascript:picture3()">picture 3</a>
</body>
</html>
[This message has been edited by keber (edited January 20, 2001).]