...

View Full Version : expert java coders... can U C where the img size is?



Gale
02-21-2007, 07:08 AM
here is the code for kinda slide show, but some of my pics in the full size get squeezed down.... can you see where that is?
Here is the html part:
<script language="javascript" type="text/javascript" src="images/common.js"></script>

</head>

<body site="1">



<!-- Holds thumbs and full together. -->
<table border="0" rules=all cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td colspan=2 valign="top"><center>
<img src="images/4cav_rating.gif" width="130" height="21" valign="center" halign="center" border="0" alt="">
<img src="images/4cav_rating.gif" width="130" height="21" valign="center" halign="center" border="0" alt="">
</center><br>
</td>
</tr>

<tr>
<td class="NonPadded" valign="top" width="550">

<table border="10" cellpadding="5" width="450" align=center id=full>
<tbody>
<tr>
<td class="NonPadded" width="400">
<br><br><br><br>
<img src="images/ottawacavaliers.jpg" width="400" height="300"
id="_ctl0_imgHouse" class="PhotoMain" name="show" onclick="openSlide();" alt="Ottawa Cavaliers">
<br>
<br>
<br>
<br>
</td>
</tr>

<tr>
<td colspan="2"></td>
</tr>

</tbody>
</table>



</td>

<td id="THUMBNAILS" class="NonPadded" valign="top" width="0">

<table id="_ctl0_eThumbnails_rptThumbnails" border="0" cellspacing="0" cols=2 align=center>
<tbody>


<!-- TEMPLATE FOR THUMBNAILS
<tr>
<td>
<a href="images/full/" target="blank" title="">
<img class="PhotoThumbnail" src="images/thumbs/" onmouseover="MM_swapImage('_ctl0_imgHouse','','images/full/',1)"></a><br>
</td>

<td>
<a href="images/full/" target="blank" title="">
<img class="PhotoThumbnail" src="images/thumbs/" onmouseover="MM_swapImage('_ctl0_imgHouse','','images/full/',1)"></a><br>
</td>
</tr>
-->

and here is the java bit:


}
}

}


}


function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


}
}
}

}


function getText(node){
if(typeof node.innerText!="undefined"){
return node.innerText;
}
return getNodeText(node);
}
function getNodeText(N){
var s = '';
for(var i=0, c=N.childNodes; i < c.length; ++i){
if(c[i].nodeType==3) s+=c[i].nodeValue;
else if(c[i].nodeType==1) s+=arguments.callee(c[i]);
}
return s

}
function openSlide(){
var Height = 900;
var Width = 500;
var Top = (screen.height / 2) - (Height / 2);
var Left = (screen.width / 2) - (Width / 2);
var params = 'resizable=yes,scrollbars=yes,height=' + Height + ',width=' + Width + ',top=' + Top + ',left=' + Left;




}


---------------------
I bet the var top and left have something to do with it..... but I am not sure.

Any ideas?

vwphillips
02-21-2007, 12:41 PM
the image size is specified in the main image tags

change the src will not change this specified size.

not recommended but simplest to remove the width and height attributes

Alex!
02-21-2007, 12:47 PM
Just like to point out....Java is NOT the same as Javascript :)

Alex

Gale
02-21-2007, 06:46 PM
I have put the height and width in the image tag, but when it shows up on the screen, it is stretched or squished.

Me thinks it's in the first bit of the java part......
unction MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

What do you think?

vwphillips
02-21-2007, 09:06 PM
simplest to remove the width and height attributes



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum