HOWTO: click to enlarge

Author Message

Björn Dieding@xrow.de

Thursday 04 August 2005 6:01:22 pm

some small javascript trick to view a larger image with out loading again

        <div class="attribute-image">
{run-once}
{literal}
<script language="Javascript" type="text/javascript">
<!--
function enlargeImage( imsrc, ww, wh ) {
    w1=window.open('','ImageEnlarged','width='+ww+',height='+wh+',status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,dependent=yes,innerHeight='+wh+',innerWidth='+ww+'');
    w1.document.open();
    w1.document.write("<html><head><\/head>");
    w1.document.write("<body style=\"margin: 0px 0px 0px 0px;padding: 0px 0px 0px 0px;\">");
    w1.document.write("<a href=\"javascript:window.close()\" style=\"margin: 0px 0px 0px 0px;border: none;padding: 0px 0px 0px 0px;\"><img name=theimg style=\"margin: 0px 0px 0px 0px;border: none;padding: 0px 0px 0px 0px;\" src=\"" + imsrc + "\" /></a>");
    w1.document.write("<\/body><\/html>");
    w1.document.focus();
};
//-->
</script>
{/literal}
{/run-once}
            <p>
            <a href="javascript:;" onClick="return enlargeImage('/{$node.data_map.image.content.original.full_path|ezurl(no}',{$node.data_map.image.content.original.width},{$node.data_map.image.content.original.height});" title="Click to Enlarge">
            {attribute_view_gui attribute=$node.object.data_map.image image_class=imagelarge}
            </a>
            </p>
        </div>

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Xavier Dutoit

Thursday 04 August 2005 11:49:31 pm

Nice trick, thanks for sharing.

X+

http://www.sydesy.com

Georg Franz

Friday 05 August 2005 8:16:07 am

Hi Björn,

well done + tx for sharing!! :-)

Best wishes,
Georg.

--
http://www.schicksal.com Horoskop website which uses eZ Publish since 2004

Softriva .com

Friday 09 February 2007 10:19:14 am

Björn,
I tried to use your JS but I think it has some error. Do you have an updated version?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 07:21:17
Script start
Timing: Jan 19 2025 07:21:17
Module start 'layout'
Timing: Jan 19 2025 07:21:17
Module start 'content'
Timing: Jan 19 2025 07:21:17
Module end 'content'
Timing: Jan 19 2025 07:21:17
Script end

Main resources:

Total runtime0.0152 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.1484152.6250
Module start 'layout' 0.00600.0029 741.773439.4453
Module start 'content' 0.00900.0043 781.218893.4297
Module end 'content' 0.01320.0019 874.648434.3047
Script end 0.0151  908.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002516.7951140.0002
Check MTime0.00117.2309140.0001
Mysql Total
Database connection0.00074.465310.0007
Mysqli_queries0.002717.501030.0009
Looping result0.00000.086510.0000
Template Total0.001610.310.0016
Template load0.00085.367810.0008
Template processing0.00074.899210.0007
Override
Cache load0.00063.811210.0006
General
dbfile0.00021.482780.0000
String conversion0.00000.066040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs