4images Forum & Community
International => Español / Castellano => Topic started by: TRISKO on October 14, 2006, 11:39:15 AM
-
Muy Buenas en el archivo jpg.html en la carpeta media tengo lo siguiente :
<!-- Template file for JPG Files -->
<img src="{media_src}" border="1" alt="{image_name}" id="imgid{image_id}"{width_height} /><br />
<script language="JavaScript" type="text/javascript">
function get_id(id)
{
if (document.getElementById) return document.getElementById(id);
if (document.all && !document.getElementById) return document.all[id];
if (document.layers) return document.layers[id];
}
function image_size(){
objImage = new Image();
objImage.onload = function ch(){resize(this.width, this.height)};
objImage.src = "{media_src}";
}
function resize(width, height)
{
var AspectRatio, FinalWidth, FinalHeight, DoResize;
DoResize=0;
FinalWidth = width;
FinalHeight = height;
if (screen.width < 1601)
{
FinalWidth = 768; DoResize=1;
}
if (screen.width < 800)
{
FinalWidth = 480; DoResize=1;
}
if (DoResize)
{
if (width > height)
{
AspectRatio = (width / height);
FinalHeight = FinalWidth/AspectRatio;
}
if (width < height)
{
AspectRatio = height / width;
FinalHeight = FinalWidth;
FinalWidth = FinalHeight/AspectRatio;
}
}
get_id("imgid{image_id}").width = FinalWidth;
get_id("imgid{image_id}").height = FinalHeight;
}
image_size();
</script>
Con este script consigo que al pinchar en los tmubnails aparezca la foto original pero se redimensiona perfectamente en la pantalla sin descuadrarse, este script lo copie de este foro , es la leche funciona perfectamente.
Pero ahí va mi pregunta como puedo aplicar el space.gif en este script.
El space.gif es crear una imagen gif transparente y ponerla en la carpeta images y según la ruta que le pongas la persona que intenta copiarte una foto , lo que copia es esta imagen gif y no la foto original.
Muchas Gracias por todo a todos este foro es genial
Un saludo
Igancio
-
Saludos,,,
Intentalo asi,,, :
<!-- Template file for JPG Files -->
<table style="background: url('{media_src}') no-repeat center; " cellpadding="{width_height}" cellspacing="{width_height}">
<tr>
<td>{link_back}<img src="{template_url}/images/spacer.gif" border="1" alt="{image_name}" id="imgid{image_id}"{width_height} /></a>{link_back_end}</td>
</tr>
</table>
<script language="JavaScript" type="text/javascript">
function get_id(id)
{
if (document.getElementById) return document.getElementById(id);
if (document.all && !document.getElementById) return document.all[id];
if (document.layers) return document.layers[id];
}
function image_size(){
objImage = new Image();
objImage.onload = function ch(){resize(this.width, this.height)};
objImage.src = "{media_src}";
}
function resize(width, height)
{
var AspectRatio, FinalWidth, FinalHeight, DoResize;
DoResize=0;
FinalWidth = width;
FinalHeight = height;
if (screen.width < 1601)
{
FinalWidth = 768; DoResize=1;
}
if (screen.width < 800)
{
FinalWidth = 480; DoResize=1;
}
if (DoResize)
{
if (width > height)
{
AspectRatio = (width / height);
FinalHeight = FinalWidth/AspectRatio;
}
if (width < height)
{
AspectRatio = height / width;
FinalHeight = FinalWidth;
FinalWidth = FinalHeight/AspectRatio;
}
}
get_id("imgid{image_id}").width = FinalWidth;
get_id("imgid{image_id}").height = FinalHeight;
}
image_size();
</script>
excitex2
-
Muchisimas Gracias por contestar tan pronto que bien :D :D :D :D :D :D :D
Acabo de probarlo y la imagen se muestra pero no se redimensiona bien
De todas formas gracias por intentarlo
Un saludo
Ignacio
-
i know to put the word spacer.gif not space.gif
I tried to do this
Ihope to works
Thanks
Ignacio
-
He cambiado las palabras y sigue sin funcionar
Bueno si alguien sabria corregir el codigo con el Space.gif se lo agradecería un montón
Gracias a todos
Este foro es superior
Un saludo
Ignacio