FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


I have a question...





mattyj
I have a question about something i want to do with my site, but dont know how

I want to have say a table with a list of links to photos on one side and i want to be able to click on a photo link and have it display on the other side of the table within the same frame

Is that possible?

I have tried doing this with Frames and also having the photo links pop up in their own window, but i dont like either way

If anyone can help that'd be great... I will even give all my Fri$ to anyone that can help me Wink

Thanks

Mat
Peterssidan
You have to use javascript to do this.
If you put this code in the inside the head tag:
Code:
<script>
   function showImage( imageURL )
   {   
      document.theImage.src=imageURL;
   }
</script>



place the image where you want it to be:
Code:
<img src="http://www.frihost.com/forums/images/avatars/1746527601452173670e3e1.png" name="theImage" />

set the src to the url to the image you want to show to start with.

The links should be like this:
Code:
<a onClick="showImage('http://www.pbase.com/mattyjsmith/image/52373425.jpg')" href="#">image1</a>

Change the url so it shows the image you want. you can have as many links like this as you want but with different urls insiside the showImage function. I think you can use relative urls if you want to.
mattyj
Thank You! Works Great!

Just one more quick question, Is there anyway after you click on the image name to stop it scrolling back to the top of the page? As where i have the images placed is about half way down the page, and after you click on the link, it scrolls back to the top


Thanks heaps!

Mat
Peterssidan
Yes if you put return false; after showImage call this will not happen.
Code:
<a onClick="showImage('http://www.pbase.com/mattyjsmith/image/52373425.jpg'); return false;" href="#">image1</a>
mattyj
Thank you so much for your help! Its really appreciated Smile Smile Very Happy
Related topics
I Have a question . Is it the server support Chinese?
Question before requesting free hosting
question abt posts/mth
Kinda dumb question regarding DNS
A question
UT2004 U like the game? Do u have any question post here.
Question about DNS!
Question about Domain!
another uni.cc question
Question
Question abt lang. support...
question!!!!!!
A question about Naruto
C++ Question
PHPBB2 Question. (What MOD makes the featured announcements?
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.