"Donius" <ra************ **@gmail.com> wrote
That'd be wonderful! Yes, i am serious. :)
OK, for what it's worth, here ya go. Apologies for the long post.
option #1, goes within popup:
_______________ _______________ _______________ _______________ __
var doneResize= 'false'
function popupResize() {
if (doneResize== 'false') {
doneResize = 'true'
imageWidth = (document.image s[0].width + 100)
imageHeight = (document.image s[0].height + 100)
var popupWidth = 320; var popupHeight = 360
while ((popupWidth < imageWidth) || (popupHeight < imageHeight)) {
self.resizeTo(p opupWidth , popupHeight); self.moveTo(scr een.availWidth -
popupWidth - 5,5)
if (popupWidth < imageWidth) {popupWidth = popupWidth + 10}
if (popupHeight < imageHeight) {popupHeight = popupHeight + 10}
}
}
}
_______________ _______________ _______________ _______________ __
option #2
I found this in the same archive (doesn't look like mine, some IE-only
filter references in there),
might be more what you're after...... see form at the end for image
attributes.
_______________ _______________ _______________ _______________ __
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=is o-8859-1">
<title></title>
</head>
<body bgcolor="white" >
<center>
<script language="JavaS cript1.2" type="text/javascript">
var winheight=100
var winwidth=100
var cat=null
// pixels to resize by per step
step=3;
function catswindows(nam e,width,height, title)
{
if (!document.all)
{
if (!document.laye rs)
{
paramstp="heigh t="+height+",wi dth="+width+",t op=10"+
",left=10,scrol lbars=no,locati on=no"+
",directories=n o,status=no,men ubar=no,toolbar =no,resizable=n o"
cat=window.open ("","cat",param stp);
oldstr="<html>< title>"+title+" </title><body
background="+na me+">"+"</b"+"ody></h"+"tml>";
cat.document.wr ite(oldstr);
if (cat.focus){cat .focus();}
return;
}
else
{
LeftPosition=(s creen.width)?(s creen.width-width)/2:100;
TopPosition=(sc reen.height)?(s creen.height-height)/2:100;
paramstp="heigh t="+height+",wi dth="+width+",t op="+TopPositio n+
",left="+LeftPo sition+",scroll bars=no,locatio n=no"+
",directories=n o,status=no,men ubar=no,toolbar =no,resizable=n o"
cat=window.open ("","cat",param stp);
loadpos=height/2-40
string="<html>< title>"+title+" </title><body bgcolor=black>< div
id=loadintxt style='position :absolute;top:" +loadpos+"px'></div>"
string1='<s'+'c ript>var
animColorIndex= 0;colorArray=["#FFFFFF","#CCC CCC","#999999", "#666666","#333 33
3","#000000","# 333333","#66666 6","#999999","# CCCCCC"];'
string2='functi on
textLooping(){i f(animColorInde x==10)animColor Index=0;documen t.loadintxt.doc u
ment.open();'
string3='docume nt.loadintxt.do cument.write("< center><font size=4
face=Comic Sans MS
color="+colorAr ray[animColorIndex]+"><b>Loading.. .</b></font></center>");doc
ument.loadintxt .document.close ();'
string4='animCo lorIndex++;};an imInterval=setI nterval("textLo oping()",200);</
s'+'cript>'
string5='<s'+'c ript language="jav'+ 'ascript1.2">'
string6="functi on
init(){document .catpic.visibil ity='show';clea rInterval(animI nterval);docume n
t.loadintxt.vis ibility='hide'; };"
string7="</s"+"cript>"
string8="<div id=catpic
style='position :absolute;left: 0px;top:0px;vis ibility:hidden' >"
string9="<img src='"+name+"' width="+width+" height="+height +" border=0
onload='init()' ></div></b"+"ody></h"+"tml>";
cat.document.wr iteln(string);
cat.document.wr iteln(string1);
cat.document.wr iteln(string2);
cat.document.wr iteln(string3);
cat.document.wr iteln(string4);
cat.document.wr iteln(string5);
cat.document.wr iteln(string6);
cat.document.wr iteln(string7);
cat.document.wr iteln(string8);
cat.document.wr iteln(string9);
if(cat.focus){c at.focus();}
return;
}
}
LeftPosition=(s creen.width)?(s creen.width-width)/2:100;
TopPosition=(sc reen.height)?(s creen.height-height)/2:100;
paramstp="heigh t="+winheight+" ,width="+winwid th+",top="+TopP osition+
",left="+LeftPo sition+",scroll bars=no,locatio n=no"+
",directories=n o,status=no,men ubar=no,toolbar =no,resizable=n o"
cat=window.open ("","cat",param stp);
string="<html>< title>"+title+" </title><body topmargin=0 leftmargin=0
bgcolor=black>"
string1="<div id=loadintxt
style='position :absolute;width :100%;top:45%;t ext-align:center;vi sibility:vis
ible;font-family:Comic Sans
MS;font-size:16px;font-weight:bold'>Lo ading...</div>"
string2="<div id=errtxt
style='position :absolute;width :100%;top:45%;t ext-align:center;vi sibility:vis
ible;font-family:Comic Sans
MS;font-size:16px;color :red;font-weight:bold;vis ibility:hidden' >ERROR!!!
Please try again</div>"
string3='<s'+'c ript>'+'var animColorIndex= 0;'+
'colorArray=["#FFFFFF","#CCC CCC","#999999", "#666666","#333 333","#000000", "#3
33333","#666666 ","#999999","#C CCCCC"];'+
'function textLooping(){i f(animColorInde x==10)animColor Index=0;'+
'loadintxt.styl e.color=colorAr ray[animColorIndex];'+
'animColorIndex ++;}animInterva l=setInterval(" textLooping()", 200);'
string4='functi on erroccur(){clea rInterval(animI nterval);'+
"loadintxt.styl e.visibility='h idden';"+
"errtxt.style.v isibility='visi ble';}"+'</s'+'cript>'
string5='<s'+'c ript language="jav'+ 'ascript1.2">'+
'function init(){clearInt erval(animInter val);'+
"loadintxt.styl e.visibility='h idden';"+
'fltr.filters.i tem(0).Apply(); fltr.filters.it em(0).Play();'+
'fltr.style.vis ibility="visibl e";}'+'</s'+'cript>';
string6='<img id="fltr"
style="filter:B lendTrans(Durat ion=5);visibili ty:hidden" src="'+name+'"
border=0'+
' width='+width+' height='+height +' onload="init()"
onerror="errocc ur()">'+
'</b'+'ody></h'+'tml>';
cat.document.wr iteln(string);
cat.document.wr iteln(string1);
cat.document.wr iteln(string2);
cat.document.wr iteln(string3);
cat.document.wr iteln(string4);
cat.document.wr iteln(string5);
cat.document.wr iteln(string6);
x = y = step
while (x | y)
{
cat.resizeBy (x, y)
if (cat.document.b ody.clientWidth >= width) x = 0
if (cat.document.b ody.clientHeigh t >= height) y = 0
}
if(cat.focus){c at.focus();}
}
function CloseCatWin()
{if(cat!=null && cat.open)cat.cl ose()}
window.onfocus= CloseCatWin;
</script>
<p>
<center>
<form>
<input type="button" tabindex="2" value="View Image"
onclick="catswi ndows('image.jp g','400','450', 'title goes here'); return
false" onfocus="this.b lur()">
</form>
</center>
</center>
</body>
</html>