473,785 Members | 2,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

best way to zoom-click a thumbnail to replace an image?

What is the best/simplest way to have a large top image with let's say 14
thumbnails under it in 7 rows and to replace the top image with the larger
one when a user clicks on a thumbnail? I would prefer to only have one html
page.

thanks,
Sep 9 '05 #1
6 7292
On Thu, 8 Sep 2005 21:12:37 -0400, "Dan V." <d@d.com> wrote or quoted
:
What is the best/simplest way to have a large top image with let's say 14
thumbnails under it in 7 rows and to replace the top image with the larger
one when a user clicks on a thumbnail? I would prefer to only have one html
page.


In Java, you use a card layout, perhaps pre-emptively downloading the
most popular big shots in the background while viewer is looking at
the thumbnails or other big shots.

In HTML you would have to load a fresh page for each big shot.

See http://mindprod.com/projects/pornviewer.html for an even fancier
idea.

--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Sep 9 '05 #2
Dan V. wrote:
What is the best/simplest way to have a large top image with let's say 14
thumbnails under it in 7 rows and to replace the top image with the larger
one when a user clicks on a thumbnail? I would prefer to only have one html
page.


Probably best done with script with a fall-back for non-scripted
browsers that opens the big image in either the current or a new window.

Try posting to comp.lang.javas cript.

Here's something to play with - turn off scripting and it loads the
image in the page. Onclicks are not added if appropriate features not
supported.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Swappi ng images play</title>
<meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-1">
<style type="text/css">
#thumbTable {border-collapse: collapse;}
#thumbTable td {
border: 1px solid blue; width: 98px; text-align: center;
}
#bigPicDiv {
width: 200px; height: 200px; border: 2px solid #ddddff;
margin-left: auto; margin-right: auto;
}
#thumbsDiv {
margin-left: auto; margin-right: auto; border: 1px solid red;
}
#bigImage {width: 200px; height: 200px;}
img {border: 0;}
</style>
<script type="text/javascript">
function swapImage(el){
var img = document.getEle mentById('bigIm age');
img.src = el.href;
}
function initLinks( id ){
if ( !document.getEl ementsByTagName
|| !document.getEl ementById ) {
return;
}
var el = document.getEle mentById(id);
var as = el.getElementsB yTagName('a');
var i = as.length;
while ( i-- ){
as[i].onclick = function() {
swapImage(this) ;
return false;
}
}
}
window.onload = function() {
initLinks('thum bTable');
}
</script>
</head><body>
<div id="bigPicDiv" >
<img src="big-a.jpg" id="bigImage">
</div>
<table id="thumbTable " align="center">
<tr>
<td><a href="big-a.jpg"><img src="a.jpg"
width="98px" height="98px"></a>
<br>Caption A
<td><a href="big-b.jpg"><img src="b.jpg"
width="98px" height="98px"></a>
<br>Caption B
</tr>
<tr>
<td><a href="big-c.jpg"><img src="c.jpg"
width="98px" height="98px"></a>
<br>Caption C
<td><a href="big-d.jpg"><img src="d.jpg"
width="98px" height="98px"></a>
<br>Caption D
</tr>
</table>
</body>
</html>

--
Rob
Sep 9 '05 #3
__/ [Dan V.] on Friday 09 September 2005 02:12 \__
What is the best/simplest way to have a large top image with let's say 14
thumbnails under it in 7 rows and to replace the top image with the larger
one when a user clicks on a thumbnail? I would prefer to only have one
html page.

thanks,


I have seen many ways of doing this in Stu Nicholls' stunning site. Have a
browser through gallery-related CSS examples. Here is one among many:

http://www.cssplay.co.uk/menu/gallery4.html#nogo

Hope it helps,

Roy

--
Roy S. Schestowitz | "Oops. My brain just hit a bad sector"
http://Schestowitz.com | SuSE Linux | PGP-Key: 74572E8E
4:30am up 15 days 6:22, 3 users, load average: 1.02, 0.78, 0.67
Sep 9 '05 #4
On Fri, 09 Sep 2005 04:32:10 +0100, Roy Schestowitz
<ne********@sch estowitz.com> wrote or quoted :
http://www.cssplay.co.uk/menu/gallery4.html#nogo


that's very clever. It does not even use JavaScript. The catch is it
requires all the full images to load before it starts working.

I have seen porn sites use a cruder version of this. They show thumbs
using full images scaled down, then when you click the image can be
fetched from cache even though the enclosing page comes from the
server.

The problem is it is much slower, and wastes time for full images you
never click.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Sep 9 '05 #5
In message <E8************ ********@golden .net>, Dan V. <d@d.com> writes
What is the best/simplest way to have a large top image with let's say 14
thumbnails under it in 7 rows and to replace the top image with the larger
one when a user clicks on a thumbnail? I would prefer to only have one html
page.

thanks,


If you don't mind your page validating as 'transitional' rather than
'strict':

Put the large image in an Iframe.

Then set target='picdisp lay' in the thumbnail-links .... where
'picdisplay' is the name of the Iframe.

When you 'click' on the thumbnail, the big-picture appears in the
Iframe.
regards.

--
Jake
(ja**@gododdin. demon.co.uk .... just a spam trap.)

Sep 9 '05 #6
__/ [Roedy Green] on Friday 09 September 2005 07:14 \__
On Fri, 09 Sep 2005 04:32:10 +0100, Roy Schestowitz
<ne********@sch estowitz.com> wrote or quoted :
http://www.cssplay.co.uk/menu/gallery4.html#nogo
that's very clever. It does not even use JavaScript. The catch is it
requires all the full images to load before it starts working.

Yes, I suspect there are better ways. I can think of something I once saw,
but no link... *frown*

I have seen porn sites use a cruder version of this. They show thumbs
using full images scaled down, then when you click the image can be
fetched from cache even though the enclosing page comes from the
server.

Pr0n sites don't attract the best Web developers in the employment pool.

The problem is it is much slower, and wastes time for full images you
never click.

Yes, I know. Loading pages entirely though with the exclusion of image /and/
without JavaScript is hard if not impossible. I have some XHMTL/CSS
presentations (S5-powered) where all graphics and text (and videos) are
loaded at the start, even if you watch one slide and a time.

Roy

--
Roy S. Schestowitz | Useless fact: There are five regular polyhedra
http://Schestowitz.com | SuSE Linux | PGP-Key: 74572E8E
11:35am up 15 days 13:27, 3 users, load average: 0.40, 0.25, 0.29
Sep 9 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2714
by: Philippe C. Martin | last post by:
Hi, I have the following convern: I have Tkinter applications that require a zoom box, and have had the following behavior without changing a line of code: 1) Mandrake 10.0/KDE 3.2/Python 2.3: no zoom box 2) Mandrake 10.0/KDE 3.2/Python 2.4: zoom box shows 3) Mandrake 10.1/KDE 3.3/Python 2.4: no zoom box 4) Mandrake 10.1/Gnome 2.6/Python 2.4: zoom box shows
0
4072
by: Francis Parsons | last post by:
Hi! I'm doubtful there's a workaround for this problem, but it's worth a shot. I'm using IE's (css) "zoom" property to zoom the body of a document (in conjunction with persistance so the previously selected percentage level is restored each time the page is reloaded). I don't expect zoomed images to look perfect, but overall the quality of the zooming is pretty good (as good as Opera's ;-) EXCEPT for any <select> elements, which are...
1
1001
by: Alex Stevens | last post by:
Hi All, I have implemented my own toolbar on a form which houses the crystal reprot viewer. I would like to have a combobox to allow the user to change the zoom level to say 25 / 50 / 75 / 100 / 200% However the crystal report viewer only seems to allow two levels of zoom, using the .Zoom method, 1 for actual size, and 2 for fit to screen. Is there any way that I can manually set the zoom level to something else
2
4388
by: Duncan Booth | last post by:
What is the best way to override the tab order in a web page? I'm trying to implement a zoom mode for part of a form, so when the zoom button is pressed that section of the form is resized to fill the entire browser window. While the user is in the zoom mode I want to stop the tab key taking them on to the next (now invisible) tabstop on the page. Ideally I want tabbing to wrap round so that tabbing forward from the last of the zoomed...
5
8661
by: MS | last post by:
I want to "maximise", then fit a report into the available window. ATM I maximise on the OnOpen event, then use send keys ...... %{v}, %{z} ....to zoom and fit to the window. Is there a better "non send keys" way to do this?
0
1493
by: davide rocchelli | last post by:
I have found a probable bug when you draw with GDI. Look this simple code Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint Const Zoom As Single = 0.001 Dim p As Pen
3
15597
by: jnag | last post by:
I am trying to implement font changer, where I have links on the banner of the site and when the user clicks on the links, the font size of the page has to change. I tried document.body.style.fontSize='50%' for example, on an onclick() event, but it did not work. I tried zooming with the following code, and it works: <td valign="baseline"><a href="#" onclick="(document.body.style.zoom)?...
5
2179
by: Summercoolness | last post by:
after using float, I know it is needed to continue the flow if we want the enclosing div to include the whole thing (with the obj being floated)... so i know of <br style="clear: both" /> or <div style="clear: both" />
4
17378
by: rakeshvthu | last post by:
Hi All, I have a requirement my Customer doesn't want to see any changes in the page when user clicks on Zoom button in IE7 or in any other browser that supports Zoom option. Can you please help to find solution for this problem. It is Urgent thank you in advance, Rakesh N.
4
15386
by: paulcybulski | last post by:
Hi I would like to apply a zoom feature where the user can scroll the mouse wheel to zoom in and out on a movieclip. I currently have zoom implemented as buttons. How would I go about implementing the wheel action? button zoom code: small.onPress = function(){ ROOT.onEnterFrame = function(){ zoom._xscale*=0.9; zoom._yscale*=0.9;
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10161
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7506
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6743
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2890
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.