By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,447 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,447 IT Pros & Developers. It's quick & easy.

Clickable DIV

P: n/a
The URL is:
http://dardel.info/tintin/random.html

What I want to achieve:
When you click a thumbnail, a window opens with a larger copy of the
pict _as the background_.
I want the new window to close when clicking anywhere on it.

Both the background of the window and the caption are produced by
Javascript, but the probleme is not here.

The code is:

<SCRIPT LANGUAGE="JavaScript">
<!--
var output = '<BODY STYLE="color: #FFF; background: #222 URL('+
opener.globalImage4 + ') fixed no-repeat center center;">'
document.write(output);
//--></SCRIPT>

<A HREF="#" onClick="window.close()">
<DIV CLASS="enveloppe">
<DIV CLASS="tete">
<P CLASS="grispetit">Click on picture to close window
</DIV>

<DIV CLASS="pied">
<SCRIPT LANGUAGE="JavaScript">
<!--
var output = opener.globalCaption4 ;
document.write(output);
//-->
</SCRIPT>
</DIV>

</DIV>
</A>

With Safari, everything is fine.
With Firefox (1.0.1 for Mac) the display is OK, but only the two text
bits are clickable (and close the window).
With old Nescape (7 for Mac), same as FIrefox.
With IE 5.2 for Mac, all is wrong and the background pict does not even
show, unless I re-load after the window is open. The two text biits are
(superposed) at the top.
With IE 5 for PC (on my VIrtualPC) the text bits are on the top, the
image shows but only the top div is clickable.

Can I find a way to have the entire window clickable? I know how to
make it if the pict is not in the background, but not if it is.

Thanks in advance for ideas.

--
François de Dardel
http://dardel.info/
Faber est suae quisque fortunae
Enlever le quatorze pour m'écrire
Remove fourteen in the address to send mail

Jan 28 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 2007-01-28 18:05:18 +0100, François de Dardel <da*******@noos.frsaid:
The URL is:
http://dardel.info/tintin/random.html

What I want to achieve:
When you click a thumbnail, a window opens with a larger copy of the
pict _as the background_.
I want the new window to close when clicking anywhere on it.

Both the background of the window and the caption are produced by
Javascript, but the problem is not here.

With Safari, everything is fine.
With Firefox (1.0.1 for Mac) the display is OK, but only the two text
bits are clickable (and close the window).
With IE 5.2 for Mac, all is wrong and the background pict does not even
show, unless I re-load after the window is open. The two text biits are
(superposed) at the top.
With IE 5 for PC (on my VIrtualPC) the text bits are on the top, the
image shows but only the top div is clickable.

Can I find a way to have the entire window clickable? I know how to
make it if the pict is not in the background, but not if it is.
I found a solution, using a transparent GIF that takes (in principle)
the whole window. This solution is now posted and works in all browsers
I have tested.

A fringe benefit of the exercise is that the picture I want to show is
a bit difficult to download (except of course with a print screen) so
that may be used by those who don't want their stuff to be copied too
easily.

--
François de Dardel
http://dardel.info/
Faber est suae quisque fortunae
Enlever le quatorze pour m'écrire
Remove fourteen in the address to send mail

Jan 30 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.