473,498 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image gallery - newbie

3 New Member
Hi,

I have an image gallery created with a table. I would like it to highligt the border around the image that is focused on, and also at the same time display a buttonimage above the image for saving the image inside the div. (Like imagesearch on askx.com). I can do this for a single image by using it's "id" but how do I do this with multiple images? And how will I hide/show the specific savebutton for each image?

Example:
<table border="0" id="pictable">
<tr><td><div class="selectedpic"this.style.borderColor='blue';" onmouseout="this.style.borderColor='white';"><img src="savebutton.gif"/><br /><img src="image1.jpg"/></div></td>
<td>image2</td><td>image3</td><td>image4</td>........</tr></table>
and so on... you get the idea.

Thank you for your time!
Mar 20 '07 #1
3 1083
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN.

Use the visibility property. Set it to 'visible' to show and 'hidden' to hide.
Expand|Select|Wrap|Line Numbers
  1. document.getElementById(id).style.visibility='visible'
Mar 20 '07 #2
homerzzz
3 New Member
Welcome to TSDN.

Use the visibility property. Set it to 'visible' to show and 'hidden' to hide.
Expand|Select|Wrap|Line Numbers
  1. document.getElementById(id).style.visibility='visible'
Thanks!

But the problem is that I have one button per image. That means that I cannot reuse the same Id on them. I dont want to write 700 scripts if my gallery contains 700 images. How do I make a general script for the whole gallery? Thanks again.
Mar 20 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
Just pass the id to a function with "id" as the argument/parameter name. Then you can use the generalised id to set the visibility for any image.
Expand|Select|Wrap|Line Numbers
  1. function show(id) {
  2. document.getElementById(id).style.visibility='visible';
  3. }
Mar 20 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
502
by: Perttu Pulkkinen | last post by:
Does anybody know a php-based image gallery, where final looks of the actual site would not be determined by the application? I mean that there would only be a php-library of objects/functions that...
8
4788
by: Chris Dewin | last post by:
Hi. I run a website for my band, and the other guys want an image gallery. I'm thinking it would be nice and easy, if we could just upload a jpg into a dir called "gallery/". When the client...
14
2761
by: Rudy | last post by:
Hello all! I been trying to get a handle with Images. I have learned alot from the fine people here. So, I also learned that thumbnail images look terrible taken from a digital cam. I know why...
10
2219
by: ste | last post by:
Hi there, I'm trying to query a MySQL database (containing image data) and to output the results in a HTML table of 3 columns wide (and however many rows it takes) in order to create a basic...
4
1779
by: RE Kochanski | last post by:
I have attempted to use the CSS techniques from two or three sites to create a CSS only image gallery. I am muddling the affair by placing the thumbnails in one float, the page text in another...
1
2282
by: gescom | last post by:
My goal is to create essentially two galleries on a single page, in which the first gallery determines what the second gallery displays. For instance, the first gallery refers to the contents of the...
0
4179
by: numbnutz | last post by:
Hi, I am currently working on an XML Gallery for my girlfriend's brother who is a photographer. I have created a flash front end template and am using an XML database to load the images and...
5
2093
by: dabhand | last post by:
Hi This page http://www.dabhand.co.nz/ayupdev/gallery-riders.html works great in IE but not in Firefox... any help would be appreciated. It refers to an external javascript file which I have...
10
6734
by: cjparis | last post by:
Hello everyone. If anyone can give me a hand I would be gratefull Am doing a site which requires a moving element and have used DHTML to do it. Have a simple Browser detect script to sort IE...
0
7004
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7208
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4593
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
657
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
292
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.