Saludos,,,
Este MOD es para que al picar sobre la imagen se pueda ver dicha imagen en un poput.Las caracteristicas del poput son las siguiente :Las dimensiones del poput se ajustan a las de la imagen,,idependientemente de que varien en cada imagen.
Al pulsar cualquier botón del raton,,, se cierra el poput.
No permite copiar la imagen de dicho poput,,, si se intenta copiar o arrastrar la imagen se cierra el poput.
Funciona tanto en details,, como en postcard.
Abrir
templates/tus_plantillas/header.htmlInserar el siguiente código entre las etiquetas <HEAD> y </HEAD> <script language="JavaScript">
<!--
function JustSoPicWindow(imageName,imageWidth,imageHeight,alt,bgcolor,hugger,hugMargin) {
if (bgcolor=="") {
bgcolor="#FFFFFF";
}
var adj=10, lift;
var w = screen.width;
var h = screen.height;
var byFactor=1;
if(w<740){
lift=0.90;
}
if(w>=740 & w<835){
lift=0.91;
}
if(w>=835){
lift=0.93;
}
if (imageWidth>w){
byFactor = w / imageWidth;
imageWidth = w;
imageHeight = imageHeight * byFactor;
}
if (imageHeight>h-adj){
byFactor = h / imageHeight;
imageWidth = (imageWidth * byFactor);
imageHeight = h;
}
var scrWidth = w-adj;
var scrHeight = (h*lift)-adj;
if (imageHeight>scrHeight){
imageHeight=imageHeight*lift;
imageWidth=imageWidth*lift;
}
var posLeft=0;
var posTop=0;
if (hugger == "hug image"){
if (hugMargin == ""){
hugMargin = 0;
}
var scrHeightTemp = imageHeight - 0 + 2*hugMargin;
if (scrHeightTemp < scrHeight) {
scrHeight = scrHeightTemp;
}
var scrWidthTemp = imageWidth - 0 + 2*hugMargin;
if (scrWidthTemp < scrWidth) {
scrWidth = scrWidthTemp;
}
if (scrHeight<100){scrHeight=100;}
if (scrWidth<100){scrWidth=100;}
posTop = ((h-(scrHeight/lift)-adj)/2);
posLeft = ((w-(scrWidth)-adj)/2);
}
if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
imageHeight=imageHeight-adj;
imageWidth=imageWidth-adj;
}
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1){
var args= new Array();
args[0]='parent';
args[1]=imageName;
var i ; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args+".location='"+args[i+1]+"'");
} else {
newWindow = window.open("{template_url}/apertura.html","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
newWindow.document.open();
newWindow.document.write('<html><title>'+alt+'</title><meta http-equiv="ImageToolbar" content="no" /><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onBlur="self.close()" onClick="self.close()">');
newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
newWindow.document.write('<img src="'+imageName+'" width='+imageWidth+' height='+imageHeight+' alt="Click para cerrar ventana" >');
newWindow.document.write('</td></tr></table></body></html>');
newWindow.document.close();
newWindow.focus();
}
}
//-->
</script>
Cerrar y guardar cambiosNombrar el siguiente código html como apertura.html y subir la nueva plantilla a templates/tus_plantillas/<HTML>
<HEAD>
</HEAD>
<body>
</body>
</html>
Abrir
templates/tus_plantillas/media/jpg.htmlCambia el código de dicha plantilla por este otro:
<!-- Template file for JPG Files -->
<a href="#"><img src="{media_src}" border="1" alt="{image_name}"{width_height} onClick="JustSoPicWindow('{media_src}','{width}','{height}','{image_name}','#000000','hug image','0');return document.MM_returnValue" width={widh} height={height} /></a></br>
OJO si trabajas con plantillas que uses background cambia el contenido de dicha plantilla, por este otro :
<!-- Template file for JPG Files -->
<table style="background: url('{media_src}') no-repeat center; " cellpadding="0" cellspacing="0">
<tr>
<td>{link_back}<a href="#"><img src="{template_url}/images/spacer.gif" border="1" alt="{image_name}"{width_height} onClick="JustSoPicWindow('{media_src}','{width}','{height}','{image_name}','#000000','hug image','0');return document.MM_returnValue" width={widh} height={height} /></a>{link_back_end}</td>
</tr>
</table>
Realizar los cambios en todas las plantillas que utiliceis,, jpg,jpeg,gif,png,,etc,etc, pero yo no cambiaría las que son de sonido o videos.
excitex2