November 3rd, 2004, 08:13 PM
|
#1 (permalink)
| | Member
Join Date: Oct 2003 Location: Calgary, Alberta
Posts: 48
| Simple HTML Image Changing Question
Hey hey,
This is probably a rather basic question for most of you, but please enlighten me. I'm trying to set up a sitatuon, where there is a main image, with small thumbnails to the side of the main image....and when the user clicks on the small thumbnails, the main image changes to whatever the thumbnail picture is. Something similar to what is setup on techimo under the galleries.
Thank you for any suggestions or help!
Jin |
| |
November 3rd, 2004, 08:37 PM
|
#2 (permalink)
| | Ultimate Member
Join Date: Oct 2001 Location: Pasadena, CA
Posts: 2,152
|
You can attain this same effect using very basic HTML frames. If you check out http://www.w3schools.com it will explain the frameset HTML tag.
There are, of course, more advanced ways to do it using scripting and such but Im guessing for your purposes its not really necessary. Of course if you want to learn let us know!
__________________
YAH! I knew you'd be jealous
|
| |
November 3rd, 2004, 09:03 PM
|
#3 (permalink)
| | Member
Join Date: Oct 2003 Location: Calgary, Alberta
Posts: 48
|
i looked through the frames section of that site, as well as the images section...all under the HTML area...i couldn't find anything related to what i want to do  |
| |
November 3rd, 2004, 09:07 PM
|
#4 (permalink)
| | Kawaru wa yo!
Join Date: Oct 2001 Location: Kingsford, MI
Posts: 16,137
|
You could also do it with a simple Javascript script. |
| |
November 3rd, 2004, 09:23 PM
|
#5 (permalink)
| | Member
Join Date: Oct 2003 Location: Calgary, Alberta
Posts: 48
|
Yeah i probably can do it with Javascript...but i'm not knowledgeable in how to write javascript....thats why i'm asking for help. |
| |
November 3rd, 2004, 09:25 PM
|
#6 (permalink)
| | Ultimate Member
Join Date: Oct 2001 Location: Pasadena, CA
Posts: 2,152
| Quote: |
Originally Posted by jinsta i looked through the frames section of that site, as well as the images section...all under the HTML area...i couldn't find anything related to what i want to do  | It wont exactly tell you how to create the page you want but it will give you the necessary information. Basically what you want is one frame of the window to contain all the image thumbs while the main portion of the window will contain the full size image. Clicking on the thumbnail will update the main frame.
To utilize a simple frameset to do this you would need to create three different HTML pages. One that contains the image thumbnails, and then another that will contain some filler information. The third HTML page will contain the frameset tags that define how the frames will be set up. |
| |
November 3rd, 2004, 09:30 PM
|
#7 (permalink)
| | Newbie
Join Date: May 2004 Location: Philippines
Posts: 3,894
|
__________________
I miss Dimebag Darrell
|
| |
November 3rd, 2004, 10:06 PM
|
#8 (permalink)
| | Kawaru wa yo!
Join Date: Oct 2001 Location: Kingsford, MI
Posts: 16,137
|
Make your layout, and then add this code. Code: In the <head> section, put:
<script type="text/javascript">
function changeMe(p)
{
document.images.change.src=p;
}
</script>
Then your main image tag should look something like this:
<img name="change" src="starting_image.jpg">
Then in each of the thumbnails, you want the add the function call, so that would look like this:
<img src="this_pic.jpg" onclick="changeMe('this_pic.jpg')"> Does that make any sense, or no? Obviously you'll replace "this_pic.jpg" with the whateve the filename is, including the path if necessary. |
| |
November 3rd, 2004, 11:30 PM
|
#9 (permalink)
| | Member
Join Date: Oct 2003 Location: Calgary, Alberta
Posts: 48
|
yeah it does, thanks alot whir! |
| |
November 3rd, 2004, 11:40 PM
|
#10 (permalink)
| | Kawaru wa yo!
Join Date: Oct 2001 Location: Kingsford, MI
Posts: 16,137
|
No problem. Post back if you have any problems. |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |
Posting Rules
| You may post new threads You may post replies You may not post attachments You may not edit your posts HTML code is Off | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |