By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,260 Members | 1,677 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,260 IT Pros & Developers. It's quick & easy.

Image show with javascript

P: n/a
ABC
I am a total newbie to javascript. I have only done Frontpage.

I am trying to do a page of image show----I only managed to find a
javascript to create pop up windows for the chosen image. Almost good
but I want better.
http://www.fontstuff.com/frontpage/fptut17.htm

I want the viewer to lick on the text word in the main page and the
corresponding image will show in the iframe instantly, (or text in the
frame and image on the main page). It will be about 30 images so I
will need to download them all first.

I cannot find any javascript to allow control of the frame from the
main page, or the main page from the frame. Please help.

main page=main.htm
image=image.htm
text=text1, text2,...
image =pic1, pic2...

ABC
Do not reply by email. Replay to NG
Jul 23 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Lee
ABC said:
I want the viewer to lick on the text word in the main page and the
corresponding image will show in the iframe instantly, (or text in the
frame and image on the main page).


I have *got* to start making an effort to keep up with accessibility options.

Jul 23 '05 #2

P: n/a
"Lee" <RE**************@cox.net> wrote in message
news:cr*********@drn.newsguy.com...
ABC said:
I want the viewer to lick on the text word in the main page and the
corresponding image will show in the iframe instantly, (or text in the
frame and image on the main page).
I have *got* to start making an effort to keep up with accessibility

options.


Agree!

This opens up for a completely new user experience...

LOL!

--
Dag.
Jul 23 '05 #3

P: n/a
"ABC" <AB*@nospam.net> wrote in message
news:5d********************************@4ax.com...
I am a total newbie to javascript. I have only done Frontpage.

I am trying to do a page of image show----I only managed to find a
javascript to create pop up windows for the chosen image. Almost good
but I want better.
http://www.fontstuff.com/frontpage/fptut17.htm

I want the viewer to lick on the text word in the main page and the
corresponding image will show in the iframe instantly, (or text in the
frame and image on the main page). It will be about 30 images so I
will need to download them all first.

I cannot find any javascript to allow control of the frame from the
main page, or the main page from the frame. Please help.

main page=main.htm
image=image.htm
text=text1, text2,...
image =pic1, pic2...

ABC
Do not reply by email. Replay to NG


"I want the viewer to lick ..." -- so would I!

Will this help? Watch for word-wrap.

<html>
<head>
<title>iframed.htm</title>
<script type="text/javascript">
var pix = new Array();
pix[0] = "http://www.fontstuff.com/images/fptut17a_small.jpg";
pix[1] = "http://www.fontstuff.com/images/fptut17b_small.jpg";
pix[2] = "http://www.fontstuff.com/images/fptut17c_small.jpg";
function pic(t) {
document.all.i.src = pix[t];
}
</script>
</head>
<body>
<center>
<a href="javascript:pic(0)">Picture 1</a> |
<a href="javascript:pic(1)">Picture 2</a> |
<a href="javascript:pic(2)">Picture 3</a>
<br><br>
<iframe name="i" align="center"
frameborder="0" scrolling="no"
marginwidth="0" marginheight="0"
style="width:150; height:112"></iframe>
<br><br>
<sup><a href="http://www.fontstuff.com/frontpage/fptut17.htm"
target="_blank">Making a Browser Window Fit an Image</a></sup>
<center>
</body>
</html>
Jul 23 '05 #4

P: n/a


McKirahan wrote:

var pix = new Array();
pix[0] = "http://www.fontstuff.com/images/fptut17a_small.jpg";
pix[1] = "http://www.fontstuff.com/images/fptut17b_small.jpg";
pix[2] = "http://www.fontstuff.com/images/fptut17c_small.jpg";
function pic(t) {
document.all.i.src = pix[t];
If you want to script frames across browsers you would better use
window.frames.i.location.href = ...
<a href="javascript:pic(0)">Picture 1</a> |
<a href="javascript:pic(1)">Picture 2</a> |
<a href="javascript:pic(2)">Picture 3</a>
<iframe name="i" align="center"
frameborder="0" scrolling="no"
marginwidth="0" marginheight="0"
style="width:150; height:112"></iframe>


What is the script good for, why not simply use links e.g.
<a href="http://www.fontstuff.com/images/fptut17a_small.jpg"
target="i">Picture 1</a>
?

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #5

P: n/a
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:41***********************@newsread4.arcor-online.net...


McKirahan wrote:

var pix = new Array();
pix[0] = "http://www.fontstuff.com/images/fptut17a_small.jpg";
pix[1] = "http://www.fontstuff.com/images/fptut17b_small.jpg";
pix[2] = "http://www.fontstuff.com/images/fptut17c_small.jpg";
function pic(t) {
document.all.i.src = pix[t];
If you want to script frames across browsers you would better use
window.frames.i.location.href = ...


Both work in IE5.5 and FF1.0.
Neither works in NS6.2 and Opera6.1 (for me).
<a href="javascript:pic(0)">Picture 1</a> |
<a href="javascript:pic(1)">Picture 2</a> |
<a href="javascript:pic(2)">Picture 3</a>


<iframe name="i" align="center"
frameborder="0" scrolling="no"
marginwidth="0" marginheight="0"
style="width:150; height:112"></iframe>


What is the script good for, why not simply use links e.g.
<a href="http://www.fontstuff.com/images/fptut17a_small.jpg"
target="i">Picture 1</a>
?


Excellent and it works in my 4 browsers!
--

Martin Honnen
http://JavaScript.FAQTs.com/

One thing I didn't do was preload the images per:

"It will be about 30 images so I will need to download them all first."

Jul 23 '05 #6

P: n/a
ABC
On Tue, 04 Jan 2005 13:27:22 GMT, "Dag Sunde" <me@dagsunde.com> wrotd:

Agree!

This opens up for a completely new user experience...

Yeah . Very funny about the typo. But that is actually possible.....

Do you have a script to help?

ABC
Do not reply by email. Replay to NG
Jul 23 '05 #7

P: n/a
ABC
Thanks very much. but I am totally new to javascript. Can you please
explain which is the bit to put in the main page to control the frame.
I supoose the one you wrote was for the frame page.

Where is the reference to the text1,text2...? I want the viewer to
click text1 and see pic1 in the frame, click text2 and the frame will
instantly change to pic2.

Thanks

On Tue, 04 Jan 2005 13:48:23 GMT, "McKirahan" <Ne**@McKirahan.com>
wrotd:
Will this help? Watch for word-wrap.

<html>
<head>
<title>iframed.htm</title>
<script type="text/javascript">
var pix = new Array();
pix[0] = "http://www.fontstuff.com/images/fptut17a_small.jpg";
pix[1] = "http://www.fontstuff.com/images/fptut17b_small.jpg";
pix[2] = "http://www.fontstuff.com/images/fptut17c_small.jpg";
function pic(t) {
document.all.i.src = pix[t];
}
</script>
</head>
<body>
<center>
<a href="javascript:pic(0)">Picture 1</a> |
<a href="javascript:pic(1)">Picture 2</a> |
<a href="javascript:pic(2)">Picture 3</a>
<br><br>
<iframe name="i" align="center"
frameborder="0" scrolling="no"
marginwidth="0" marginheight="0"
style="width:150; height:112"></iframe>
<br><br>
<sup><a href="http://www.fontstuff.com/frontpage/fptut17.htm"
target="_blank">Making a Browser Window Fit an Image</a></sup>
<center>
</body>
</html>

ABC
Do not reply by email. Replay to NG
Jul 23 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.