New guy to javascript needs help!

C

chrisdude911

Hi,
I am new to javascript and i need help!
I am trying to make a picture display where i click on a small
thumbnail picture and it displays in a bigger picture box
Here is my code so far:

<html>
<head>
<title>Pics</title>
</HEAD>
<body>
<table border="1">
<tr>
<td>
<a href="picbox" onclickload="guitar">
<img id="guitar" src="guitar.jpg" height="200" width="100">
</a>
</td>

<td>
<id="picbox">
</td>
</tr>

</table>
</body>
</html>

Could anyone help?
Thanks
Chris
 
E

Evertjan.

chrisdude911 wrote on 26 apr 2006 in comp.lang.javascript:
Hi,
I am new to javascript and i need help!
I am trying to make a picture display where i click on a small
thumbnail picture and it displays in a bigger picture box
Here is my code so far:

<html>
<head>
<title>Pics</title>
</HEAD>
<body>
<table border="1">
<tr>
<td>
<a href="picbox" onclickload="guitar">

what is "onclickload"?
"picbox" is not a page to go to
<img id="guitar" src="guitar.jpg" height="200" width="100">

If you start now start using style css
</a>
</td>

<td>
<id="picbox">

id is not a html element
</td>
</tr>

</table>
</body>
</html>

============================

Try this [not tested]:

========= test.html ==========

<style>
..small {height:100px;margin:2px;}
..large {height:600px;border:black 2px solid;}
</style>

<script type='text/javascript'>
function toPicbox(x){
document.getElementById('picbox').src = x.src;
}
</script>

<img src="guitar.jpg" class='small' onclick='toPicbox(this)'>
<img src="piano.jpg" class='small' onclick='toPicbox(this)'>
<img src="drums.jpg" class='small' onclick='toPicbox(this)'>
<br><br>
<img src='startempty.jpg' id="picbox" class='large'>

============================
 
E

Evertjan.

chrisdude911 wrote on 26 apr 2006 in comp.lang.javascript:
Thanks
That works!!!!!!

a final advice, because this is not email:

Please quote what you are replying to. If you want to post a followup via
groups.google.com, don't use the "Reply" link at the bottom of the article.
Click on "show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
<http://www.safalra.com/special/googlegroupsreply/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top