Mam kod:
  1. <?php
  2. $strona=1;
  3. if(isset($_GET['strona']))
  4. {
  5. $strona=$_GET['strona'];
  6. }
  7. ?>

  1. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  2. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2" />
  3. <title>Untitled</title>
  4. <style type="text/css">
  5. #male
  6. {
  7. z-index:5;
  8. }
  9. #strony
  10. {
  11. z-index:5;
  12. }
  13. #powiekszone_a
  14. {
  15. z-index:10;
  16. width:1px;
  17. height:1px;
  18. background-image:none;
  19. position:fixed;
  20. top:0;
  21. left:0;
  22.  
  23. }
  24. .powiekszone_klasa
  25. {
  26. z-index:15;
  27. }
  28. </style>
  29. <script type="text/javascript">
  30.  
  31.  
  32.  
  33.  
  34. function powieksz(a)
  35. {
  36. var div=document.getElementById('powiekszone_a');
  37. var newImg = new Image();
  38. newImg.src = "http://localhost/zdjecia/zdj/"+a+".JPG";
  39. var height = newImg.height;
  40. var width = newImg.width;
  41. document.getElementById(div).style.width=width;
  42.  
  43. document.getElementById(div).style.height=height;
  44.  
  45.  
  46. }
  47.  
  48.  
  49.  
  50. function strony()
  51. {
  52. ///////////// STRONY ///////////////////
  53. var ile_zdjec=191,strona_teraz=<?php echo $strona;?>;
  54. var ile_stron=ile_zdjec/15;
  55. ile_stron=Math.ceil(ile_stron);
  56. var text="<center>";
  57. for(var i=1;i<=ile_stron;i++)
  58. {
  59. if(i==strona_teraz)
  60. {
  61. text+="<a href='strona.php?strona="+i+"' style='font-weight:bold;text-decoration:none;color:black;'>"+i+"</a> | ";
  62. }
  63. else
  64. {
  65. text+="<a href='strona.php?strona="+i+"'>"+i+"</a> | ";
  66. }
  67.  
  68. }
  69. text+="</center>";
  70.  
  71. ///////////////////////////////////////////////////////
  72.  
  73. ////////// MAŁE //////////////////////////////
  74. var pierwsze_zdjecie=strona_teraz*15-14,text_male="<center>",licznik=1,apo="";
  75.  
  76. for(var i=pierwsze_zdjecie;i<=pierwsze_zdjecie+14;i++)
  77. {
  78. var sciezka="http://localhost/zdjecia/zdj/"+i+".JPG";
  79. apo="'"+i+"'";
  80. text_male+="<img src='"+sciezka+"' WIDTH=200 HEIGHT=200 onclick='powieksz("+apo+")'> | ";
  81. if(licznik==5)
  82. {
  83. text_male+="</br>";
  84. licznik=1;
  85. }
  86. else
  87. {
  88. licznik++;
  89. }
  90. }
  91.  
  92. text_male+="</center>";
  93. document.getElementById('male').innerHTML=text_male;
  94. document.getElementById('strony').innerHTML=text;
  95. }
  96. </script>
  97. </head>
  98.  
  99. <body onload="strony()">
  100.  
  101. <div id="powiekszone">
  102. <div id="powiekszone_a">
  103.  
  104. </div>
  105. <div id="strony">
  106.  
  107. </div>
  108. <div id="male">
  109.  
  110. </div>
  111.  
  112. </body>
  113. </html>


na tej stronie pojawiają się zdjęcia. po naciśnięciu na jakiś powinna wykonać się funkcja powiększ(), ale nie wiem skąd w chrome wyskakuje błąd: Uncaught SyntaxError: Unexpected token }. Nie wiem jak w innych przeglądarkach