Back to CoolMiniOrNot
eBay technique: JavaScript thumbnails
Intermediate
Return to article index
Rating: 10.00 Votes: 6
Views: 5510
By: hakoMike
Category: General Subcategory: MiscDate: 2006-11-16 07:44:31
1 2 3 4 Next
Since many CMON'ers sell painted minis on eBay, I would lile to share my technique for embedding your own photo set into your auctions, including thumbnails that can be clicked to change a larger photo.  Since eBay charges per photo that you place in your auction and limits the size of the photos included, this technique is helpful is presenting many detailed photos in an attractive and cost effective manner.

Prerequisites:
  • Image Processing tool (I recommend GIMP, and it's free.)
  • Photobucket account (again, free.  We will use Photobucket in this tutorial to store the images.)
  • the ability to copy/paste a url from one place to another
  • Bravery in the face of simple HTML
  • an eBay account with which to list auctions (optional, I suppose)
This tutorial does not require knowledge of html, but a basic knowledge will help.

First off, here is an example of what we are talking about: http://hakosoftware.com/pages/jsthumbs/
As you click on each of the thumbnails on the left of the large image, the large image changes to show a larger version of the thumbnail you clicked.  The HTML to create this example page is the exact HTML I use to create auction listings, copied and pasted into the Item Description area. 


Part 1: Basic HTML Overview
Again, you don't need to know HTML to use this technique, but a basic understanding of how HTML tags work will help you make better auction listings.  If this part is too scary, or if you already know HTML, skip on to part 2.

HTML (HyperText Markup Language) is made up of tags and text.  Tags are wrappers that tell the browser (Internet Explorer, Safari, Firefox, etc.) how to show the page.
Example:
  This HTML: This text is <b>bold</b>.
  Shows this: This text is bold.
The <b> and </b> are the bold tag.  When the browser reads <b> it know it should start showing text in bold, and when it read </b> is knows it should stop showing text in bold.  Most of HTML is in the <tag>something</tag> format.  Some tags do not require ending tags, like the tag to show an image, but most do.
(Side note: the <b> tag is outdated but still usable at this point, but it makes a good example of an HTML tag.  The current standard for changing text is to use a <span> tag, with a style attribute in it.  <b>my bold text</b> is now <span style="font-weight:bold">my bold text</span>

In this technique, we will display images using the <img> tag, and then make them do something by adding an "OnClick" attribute to each image.  OnClick does just what it says; when the viewer clicks on the image, do something.  We'll talk more about this in a minute.

The <img> tag
To embed an image on a web page, use the <img> tag.  <img> required no closing </img> tag.  The simplest format is this:
    <img src="http://coolminiornot.com/CMONlogoblack200607.jpg">
When the browser reads this tag, it fetches the image at the address in the "src" attribute and displays the image.

Before we go on, here's a preview of what the tags will look like that produces thumbnails that update the larget image when clicked:
<img onClick="change_pic('http://i3.photobuecket.com/albums/y57/hakoMike/Warmachine/Mercenaries/Ashlynn%2-dElyse/final4.jpg')" src="http://i3.photobucket.com/albums/y57/hakoMike/Warmachine/Mercenaries/Ashlynn%20dElyse/th_final4.jpg">

Now, so you get too freaked out, I'll put it in more simplified terms:
<img onClick='change_pic(bigpic_1)' src='thumbnail_1'>
1 2 3 4 Next
JesterzUSMC
02 April 09
Rating: 10
Sweet!

mickc22
21 November 06
Rating: 10
nice one Mike, really handy, I've been playing about with some older pics, works a treat!-Mick

hakoMike
20 November 06
Great addition, TobiWan. I have updated the source on the example page to add that style element.
TobiWan
20 November 06
Rating: 10
Nice idea! The thumbnail image tags still need the style="cursor:pointer;" attribute - makes it easier to understand that you can actually click on them!

You are not logged in.
If you would like to leave a comment and don't have an account, please signup.
You'll get access to Vote tracking so you will never see the same miniature twice (unless you want to) and many other enhancements to your browsing experience.

Start voting!
Menu
Home
Browse gallery
Top 10
Top 50 Artists
Top Last 7 days
Competition Gallery
Recent Auctions
Account Functions
Member Login
Sign-up

Get an account for:
-Vote Tracker
-Theme Manager
-Comments
-Forums
-Messages
-Shouts
Signup Now!
Community
Articles
Forums
Blogs
Advertise
Supporters
CoolMiniOrNot Shop
News
FAQ
Contact Us
Submit News
Statistics

Search images


eg. "Confrontation"

the id of the picture
Recent Articles
Bone-colored Cryx bonejack, step by step
- Pate5 24-10
Nurgle Armor
- Aliengod3 12-8
Simple rust tutorial
- lord von braken 9-8
How to make Double Twist barbed wire
- mickc22 16-7
How to make a Lava Themed Gaming Table
- Menelker 12-6
Making Army Transport Trays for Storing Figures
- Menelker 11-6
Recently on the Forums
Where do i get more GW brass etched?
- nels0nmac 21-11 04:56am
Mini-Exchange 22 - Two little ducks...
- dr gibbon 21-11 04:49am
Rain in England - anyone here affected?
- SJB 21-11 04:28am
Shaky hands
- Ribonucleic 21-11 03:16am
Seeing is believing
- freakinacage 21-11 03:14am
Something neat from Forge World
- freakinacage 21-11 03:13am
Recent Blogs
Cirith Ungol - next step
- Observer 20-Nov 02:05am
Plenty of progress... but no achievements
- RevMini 17-Nov 02:13pm
Inquisitorial land rader. More flatwork
- skeeve 17-Nov 07:17am
Welcome!
- CaptainAnarchy 23-Oct 09:04am
Techpriest Conversion + Sky-Earth NMM Chrome
- slobby 23-Oct 07:32am