Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer avg backup black screen boot bsod computer connection crash css dell driver drivers email error ethernet excel explorer firefox firefox 3 freeze hard drive internet internet explorer itunes laptop linux malware monitor network networking outlook outlook 2003 outlook 2007 outlook express partition problem router security slow software sound trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
code to switch pictures


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
AnyKey's Avatar
Distinguished Member with 2,101 posts.
 
Join Date: Aug 2000
Location: in my mind
23-Feb-2006, 10:21 AM #1
code to switch pictures
I am trying to figure out how the switching of pictures is done. Maybe it is javascript. Here is an example of what I want to do.

http://cgi.ebay.com/VINTAGE-Electric...QQcmdZViewItem

Clicking on the small picture switches it into the larger space. I like this feature.

I think it's probably some template on eBay, but I would like to be able to code this myself. I don't really even know the correct terminology to describe it, so any help would be great. You can't find the answer if you don't know how to ask the question.
treydx's Avatar
Senior Member with 112 posts.
 
Join Date: Jan 2006
Experience: Intermediate
23-Feb-2006, 04:01 PM #2
Yes, that is done in JavaScript. It's not too difficult. Look around for "Javascript Image Preloading" tutorials and such. You can probably also find exactly what you need if you search for "rollover" scripts. Just use an onclick event attached to a thumbnail instead of an onmouseover event attached to the image itself.

Basically you reference your big image:
var myPic = document.getElementById("myMainImage") or some such referencing

then you can change the source of the picture in javascript.
myPic.src = "mybigpicfromthumbnail.jpg";
when the actual source was something else:
<img src="mystartingpic.jpg" id="myMainImage" />

Look for preloading scripts and it'll tell you more formally how to preload your images so it switches instantly and declare your myPic variable as an image, etc.
AnyKey's Avatar
Distinguished Member with 2,101 posts.
 
Join Date: Aug 2000
Location: in my mind
24-Feb-2006, 09:49 AM #3
Thank-you!!! Exactly what I needed to know!!!
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:23 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.