Dans un effort pour rendre la page de travail avec Safari, Firefox et IE, j'ai essayé deux solutions.
L'aide serait appréciée,
1. Déplacer la fonction à une autre. Js. Cela semble être la meilleure approche, mais ni l'. Js est une erreur ou je ne sais pas comment l'appeler.
Une version du code et. Js ci-dessous.
2. Utilisation de "si" et "si" "else". Jusqu'ici, je n'ai pas été capable de trouver l'un de ces qui sépare Safari, IE, Firefox, etc
<! DOCTYPE html PUBLIC "- / / W3C / / DTD XHTML 1.0 Transitional / / EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3. org/1999/xhtml "lang =" fr "xml: lang =" fr ">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title> Test File </ title>
<script type="text/javascript" src="loadlargeview.js"> </ script>
<link href="loadlargeviewcopy.js" rel="javascript" type="text/javascript" />
<link href = "index. css "rel =" stylesheet "type =" text / css "/>
</ head>
<body>
<table align="center" width="650">
<tr>
<td>
<center>
<a href="loadLargeViewcopy.js(images/irisflower.jpg,Large View, 650, 848, 500, 500)">
<img src = "images / irisflower_small. jpg "alt =" image "width =" 160 "height =" 209 "align =" bottom "/>
<br />
<strong> Large View </ strong>
</ a>
</ center>
</ td>
</ tr>
</ table>
</ body>
</ html>
****
/ / Fonction loadLargeView par Richard A. Hyman; www.rhyman.net
/ / Copyright © RAHyman, tous droits réservés.
/ / Pour l'utilisation, R. Hyman contact par e-mail à "rick @ t rhyman.net"
var largeURL;
var theWinTitle;
var imagewidth;
var imageHeight;
var windowWidth;
var windowHeight;
var = imageRatio imagewidth / imageHeight;
var = scriptStr \ r window.onresize = resizeMyImage;;
var loadedWin = window.open (,, location = 0, height = + + windowHeight, width = + + windowWidth, scrollbars = 0, resizable = 1);
loadedWin.document. write (<html> <head> <title> theWinTitle + + </ title>);
loadedWin.document.write (\ r <script language=\"javascript1.2\">);
loadedWin.document.write (\ r resizeMyImage fonction () ();
loadedWin.document.write (\ r imageRatio var = imageRatio + +;);
loadedWin.document.write (\ r newWinWidth var = window.innerWidth; newWinHeight var = window.innerHeight; windowRatio var = newWinWidth / newWinHeight;);
loadedWin.document. write (\ r if (windowRatio> imageRatio) (document.main_image.height = newWinHeight; document.main_image.width = newWinHeight * imageRatio;) else (document.main_image.width = newWinWidth; document.main_image.height = newWinWidth / imageRatio) );
loadedWin.document.write (\ r));
loadedWin.document.write (scriptStr);
loadedWin.document.write (\ r </ script> </ head> <body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>);
loadedWin.document. write (<img src=+largeURL+ name=\"main_image\">);
loadedWin.document.write (</ body> </ html>);
loadedWinRatio var = windowWidth / windowHeight;
if (loadedWinRatio> imageRatio) (
loadedWin.document.main_image.height = windowHeight;
loadedWin.document.main_image.width = windowHeight * imageRatio;
) Else (
loadedWin.document.main_image.width = windowWidth;
loadedWin.document.main_image. height = windowWidth / imageRatio;
)
/ / Fin de loadLargeView