Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Confused, Please help!(it's quick)
Old 04-20-2007, 08:16 PM Confused, Please help!(it's quick)
The PHP Professor

Posts: 340
Name: Alex
Location: Behind You
Trades: 0
Warning: Noob at Java

I want to make it so that when you click on the "Image" link the picture appears and the other link appears too, no problem i got that down.

But when i click on the "Link" link the picture goes away and the the "Image" link re appears. I can get it to do that part. Heres my current nooby code:

Code:
 
<script language='Javascript'>
function image()
{
  var image = document.getElementById('image');
  var link = document.getElementById('link');
  var picture = document.getElementById('picture');
  image.style.display="none";
  link.style.display="inline";
  picture.style.display="inline";
}
function link()
{
  var image = document.getElementById('image');
  var link = document.getElementById('link');
  var picture = document.getElementById('picture');
  image.style.display="inline";
  link.style.display="none";
  picture.style.display="none";
}
</script>
i other words:

when i click the "image" link the picture appears with the "Link" link,

and when i click the "Link" link everything goes back the way it was.
__________________
Go Kirby! <(" . "<) (^" . "^) (>" . ")> Talkupation!
microcolt is offline
Reply With Quote
View Public Profile Visit microcolt's homepage!
 
 
Register now for full access!
Old 04-23-2007, 10:14 AM Re: Confused, Please help!(it's quick)
jito's Avatar
MY LIFE IS 'i' LIFE

Posts: 565
Name: surajit ray
Location: inside the heart of my friends
Trades: 0
i think u are calling the functions like this:
Code:
<IMG SRC="pic.jpg" id="picture" style="display:none">
<A HREF="#" id="link" onclick="link();">Link</A>
<A HREF="#" id="image" onclick="image();">image</A>
Just remove link.style.display="inline"; from the first and link.style.display="none"; from the second function.
__________________
I am not smart, that's why i don't act smart


Please login or register to view this content. Registration is FREE
jito is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Confused, Please help!(it's quick)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.17983 seconds with 12 queries