JavaScript Image Popup's

S

Santander

there are many versions of JavaScipt image popups exist which show image
preview when we click on a thumbnail image to view a larger version.
What is the best way?
 
S

Santander

both looks nice, not not too practical. The 1st sample takes a time when
load/adjust window, plus add this Vista "black background" effect, whereas
the regular javascript popup works faster - just open on click and close on
click. 2nd one show preview on mouseover. What I meant is simple popup that
opens on click on closes on click.

thanks.
 
T

Thomas 'PointedEars' Lahn

Santander said:
there are many versions of JavaScipt image popups exist which show image
preview when we click on a thumbnail image to view a larger version.
What is the best way?

Probably nothing that already exists, including Lightbox & Co. It needs to
be interoperable, fully standards-compliant, easy to write, and must work if
client-side script support is disabled; pick two.

Your From header is borken.


Score adjusted

PointedEars
 
S

Santander

so what is sample of easy, interoperable, standards-compliant, working even
when client-side script support is disabled script?
Somethingf simple with href?

Santander
 
S

SAM

Le 10/14/08 6:10 PM, Santander a écrit :
both looks nice, not not too practical. The 1st sample takes a time when
load/adjust window, plus add this Vista "black background" effect,
whereas the regular javascript popup works faster - just open on click
and close on click. 2nd one show preview on mouseover. What I meant is
simple popup that opens on click on closes on click.

The second works too with onclick
(probably not with IE < 8)

You asked the best ways, no ?
They are.

Popups are most of the time badly appreciated by users.
(some browsers can be fixed to disallow them)

Today the displaying of big image in same window is the way.
(if javascript is enabled)
(if not, the big image is displayed in same window and the user has to
click the back button of is navigator to come back to the gallery)

<a href="big_image.jpg" onclick="return pop(this)">
<img src="small_image" alt="thumbnail" title="venus">
</a>


JS :
====
var IE=false; /*@cc_on IE=true; @*/
function pop(what) {
var v = document.getElementById('viewer');
v.src = what.href;
v.style.display = 'block';
if(IE) {
var top = document.body.scrollTop ||
document.documentElement.scrollTop;
v.style.top = +top +10 + 'px';
}
return false;
}

CSS :
=====
#viewer { position: fixed; top: 10px; right: 20px; padding: 10px;
background: #999; border: 5px outset gold; display: none;
cursor: pointer;
/* hack IE */ _cursor: hand; _position: absolute;
}

HTML :
======
<img src="" id="viewer" alt="" onclick="this.style.display='none';"
title"click to close me">
</body>
 
S

Santander

The code you specified does not work though. please show it in HTML page.

Santander
-------------
 
S

Santander

some details about viewer css:

#viewer { position: fixed; top: 10px; right: 20px;
padding: 10px; cursor: pointer;
background: #999; border: 5px outset gold; display: none;
_position: absolute; _cursor: hand;
}
div { height: 300px; margin-top: 20px; }
div img { width: 200px }

Thumbnails size controlled by this code?
div { height: 300px; margin-top: 20px; }
div img { width: 200px }

do this line goes right before the closing </body> tag?
<img src="" id="viewer" alt="" onclick="this.style.display='none';"
title"click to close me">

Santander
------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top