Witam. Zamieściłem sobie znaleziony w sieci ten kod który ładnie przyciemnia stronę i wyświetla boxa z txtem.
Działa mi poprawnie. Natomiast chciałbym dowiedzieć sie od was jak zmodyfikować ten kod aby box był jpg'iem bądź jpg wyświetlał się w tym boxie.
zmieniałem background boxa ale niestety nie wyświetlało go juz w ogóle.

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Simple JQuery Modal Window from Queness</title>
  6. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
  7.  
  8. <script type="text/javascript">
  9. $(document).ready(function() {
  10.  
  11. var id = '#dialog';
  12.  
  13. //Get the screen height and width
  14. var maskHeight = $(document).height();
  15. var maskWidth = $(window).width();
  16.  
  17. //Set heigth and width to mask to fill up the whole screen
  18. $('#mask').css({'width':maskWidth,'height':maskHeight});
  19.  
  20. //transition effect
  21. $('#mask').fadeIn(1000);
  22. $('#mask').fadeTo("slow",0.8);
  23.  
  24. //Get the window height and width
  25. var winH = $(window).height();
  26. var winW = $(window).width();
  27.  
  28. //Set the popup window to center
  29. $(id).css('top', winH/2-$(id).height()/2);
  30. $(id).css('left', winW/2-$(id).width()/2);
  31.  
  32. //transition effect
  33. $(id).fadeIn(2000);
  34.  
  35. //if close button is clicked
  36. $('.window .close').click(function (e) {
  37. //Cancel the link behavior
  38. e.preventDefault();
  39.  
  40. $('#mask').hide();
  41. $('.window').hide();
  42. });
  43.  
  44. //if mask is clicked
  45. $('#mask').click(function () {
  46. $(this).hide();
  47. $('.window').hide();
  48. });
  49.  
  50. });
  51.  
  52. </script>
  53.  
  54. <style type="text/css">
  55. body {
  56. font-family:verdana;
  57. font-size:15px;
  58. }
  59.  
  60. a {color:#333; text-decoration:none}
  61. a:hover {color:#ccc; text-decoration:none}
  62.  
  63. #mask {
  64. position:absolute;
  65. left:0;
  66. top:0;
  67. z-index:9000;
  68. background-color:#000;
  69. display:none;
  70. }
  71. #boxes .window {
  72. position:absolute;
  73. left:0;
  74. top:0;
  75. width:440px;
  76. height:200px;
  77. display:none;
  78. z-index:9999;
  79. padding:20px;
  80. }
  81. #boxes #dialog {
  82. width:375px;
  83. height:203px;
  84. padding:10px;
  85. background-color:#ffffff;
  86. }
  87. </style>
  88. </head><body>
  89.  
  90. <div id="boxes">
  91. <div style="top: 199.5px; left: 551.5px; display: none;" id="dialog" class="window">
  92. Simple Modal Window |
  93. <a href="#" class="close">Close it</a>
  94. </div>
  95. <!-- Mask to cover the whole screen -->
  96. <div style="width: 1478px; height: 602px; display: none; opacity: 0.8;" id="mask"></div>
  97. </div>
  98. </body>
  99. </html>


///edit

Dodawałem ścieszke do jpg'a w DIVie w CSSie i nic.