
06-11-2005, 12:48
|
|
|
|
חבר מתאריך: 09.10.04
הודעות: 165
|
|
בתגובה להודעה מספר 1 שנכתבה על ידי THE-BLUE-DRAGON שמתחילה ב "עזרה בפתיחת תמונה בחלון חדש לפי גודל התמונה"
תודה!
מצאתי דרך גם מגניבה לעשות זאת!
החלון נפתח בגודל של התמונה לפי הגדרה ואפשר לשמור את התמונה
ובשביל לסגור על החלון פשוט לוחצים על התמונה שנפתחה בצורה ממש מגניבה או כמובן על X
אה והתמונה נפתחת במרכז המסך של המשתמש.
=)
הנה הקוד!
את החלק הזה שמים בין ה:
</head>
לבין ה
<body>
קוד:
<script language="javascript">
<!---
var bigpicWin = null;
function showbigimage(url, picwidth, picheight, description)
{
if (!bigpicWin || bigpicWin.closed)
{
usrwidth = screen.width;
usrheight = screen.height;
winwidth = picwidth;
winheight = picheight;
var X = (usrwidth - winwidth) / 2;
var Y = (usrheight - winheight) / 2;
properties = "toolbar=no,location=no,directories=no,status=no,sc rollbars=no,resizable=no,copyhistory=no,width="+winwidth+",height="+winheight+",";
checkie = navigator.appName.indexOf("icrosoft");
if (checkie == -1)
{
properties = properties+"screenX="+X+",screenY="+Y;
}
else
{
properties = properties+"left="+X+",top="+Y;
}
bigpicWin = window.open('','bigpicWin',properties);
bigpicWin.document.open();
bigpicWin.document.write('<HTML><HEAD>');
bigpicWin.document.write('<TITLE>'+description+'</TITLE>');
bigpicWin.document.write('</HEAD>');
bigpicWin.document.write('<BODY MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0" BOTTOMMARGIN="0">');
bigpicWin.document.write('<A HREF="javascript:self.close()"><IMG SRC="'+url+'" HSPACE="0" VSPACE="0" BORDER="0"></A>');
bigpicWin.document.write('</BODY>');
bigpicWin.document.write('</HTML>');
bigpicWin.document.close()
bigpicWin.focus();
}
else
{
bigpicWin.focus();
}
}
//--->
</script>
ולאחר מכן פשוט שמים את התמונות איפה שרוצים בצורה כזו:
קוד:
<A href="javascript:showbigimage('big.jpg',400,300,'')"><IMG src="small.jpg" width=85 height=85 style="border:black 1px solid;"></A>
מומלץ בחום!

|