Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 28th, 2006, 09:07 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default Image Gallery Help

I am creating a website mostly for showing photos. It's a basic website but on my gallery page I want the preview for each image to show at the top of the page. Without reloading the page. The web server supports php which I am not familiar with. Is there a way to even do this with tables, when you click on an image, the preview shows in the top table? I also need different text to show beside each image preview. I hope someone can help.

Thanks

-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason
__________________
-----------------------------------------------------------
\"Don\'t follow someone who\'s not going anywhere\" John Mason
 
Old February 1st, 2006, 12:53 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi Morpheus!!

Yes you can do this,in the top table put a <img> or image tag,
on click of the image name, load the image in top table with image's original height and width.

Hope this will help you


Cheers :)

vinod
 
Old February 9th, 2006, 01:39 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii Morpheus!!!!

plz try the code.
Hope this will help you

 <script>
function clickit(imgname)
{

obj=document.getElementById("id1")

//create a tempobject
tempimg=document.createElement("img")
tempimg.src=imgname

//tempimg.src can be either to local folder or any other sites
//tmpimg.src="text.gif"
//in case of local files
//tmpimg.src="http://anyothersite1919.com/foldername/imagename.gif"
// in case of other websites-servers

obj.src=imgname
obj.height=tempimg.height
obj.width=tempimg.width

}
</script>


<table>
</tr>
  <tr><td>
<img id="id1" src="" width="38" height="76" border="0" ></td>
  <td width="100%">&nbsp;</td>
<td>test</td>
 </tr>
</table>

<a href="javascript:clickit('img1.jpg')">View Image1</a> <br>
<a href="javascript:clickit('img2.jpg')">View Image2</a> <br>
<a href="javascript:clickit('img3.gif')">View Image3</a> <br>
<a href="javascript:clickit('img4.gif')">View Image4</a> <br>
<a href="javascript:clickit('img5.gif')">View Image5</a> <br>
<a href="javascript:clickit('img6.gif')">View Image6</a> <br>
<a href="javascript:clickit('img7.gif')">View Image7</a> <br>


Cheers :)

vinod
 
Old February 20th, 2006, 07:45 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply's, this project was on hold for a while. I will try your suggustions and let you know.

Thanks

-----------------------------------------------------------
"Don't follow someone who's not going anywhere" John Mason





Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to Create Image Gallery jazzcatone ASP.NET 2.0 Basics 0 September 23rd, 2007 04:06 AM
How to create a video gallery CurvyBabe C# 0 November 15th, 2006 06:17 AM
Gallery Image display in popup Window caitydev ASP.NET 1.0 and 1.1 Basics 3 April 3rd, 2006 10:23 AM
JavaScript Image Gallery welshboy2005 Javascript How-To 0 May 20th, 2005 04:55 AM
gallery problems surethg Beginning PHP 0 November 14th, 2004 12:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.