Здравствуйте.Я новичок,не судите строго.Помогите,что я сделал не так?
При нажатии на картинку ничего не происходит.Ссылка создается
http://shop/view_content.php?id=1#image1 но увеличенной фотки не появляется,вообще ничего не появляется.Папка fancybox лежит в корне сайта Z:\home\shop\www\fancybox
Части кода:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
<link rel="stylesheet" type="text/css" href="http://shop//fancybox/jquery.fancybox.css" />
<script type="text/javascript" src="http://shop//fancybox/jquery.fancybox.js"></script>
<script type="text/javascript" src="http://shop//js/jTabs.js"></script>
<title>Интернет-Магазин Бетонных Конструкций</title>
<script type="text/javascript">
$(document).ready(function(){
$(".image-modal").fancybox();
});
</script>
</head>
Еще:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
echo '
<li>
<a class="image-modal" href="#image'.$row["id"].'"><img src="'.$img_path.'" width="'.$width.'" height="'.$height.'" /></a>
</li>
<a style="display:none;" class="image-modal" rel="group" id="image'.$row["id"].'" ><img src="./uploads_images/'.$row["image"].'" /></a>
';
}
while ($row = mysql_fetch_array($result));
echo '
</ul>
</div>
';
Ну и весь код на всякий случай:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
<?php
include("include/db_connect.php");
include("functions/functions.php");
$id = clear_string($_GET["id"]);
If ($id != $_SESSION['countid'])
If ($id != $_SESSION['countid'])
{
$querycount = mysql_query("SELECT count FROM table_products WHERE products_id='$id'",$link);
$resultcount = mysql_fetch_array($querycount);
$newcount = $resultcount["count"] + 1;
$update = mysql_query ("UPDATE table_products SET count='$newcount' WHERE products_id='$id'",$link);
}
$_SESSION['countid'] = $id;
?>
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<link href="css/reset.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="/js/jcarousellite_1.0.1.js"></script>
<script type="text/javascript" src="/js/shop-script.js"></script>
<link rel="stylesheet" type="text/css" href="http://shop//fancybox/jquery.fancybox.css" />
<script type="text/javascript" src="http://shop//fancybox/jquery.fancybox.js"></script>
<script type="text/javascript" src="http://shop//js/jTabs.js"></script>
<title>Интернет-Магазин Бетонных Конструкций</title>
<script type="text/javascript">
$(document).ready(function(){
$(".image-modal").fancybox();
});
</script>
</head>
<body>
<div id="block-body">
<?php
include("include/block-header.php");
?>
<div id="block-right">
<?php
include("include/block-category.php");
include("include/block-news.php");
?>
</div>
<div id="block-content">
<?php
$result1 = mysql_query("SELECT * FROM table_products WHERE products_id='$id' AND visible='1'",$link);
If (mysql_num_rows($result1) > 0)
{
$row1 = mysql_fetch_array($result1);
do
{
if (strlen($row1["image"]) > 0 && file_exists("./images/polusfera/".$row1["image"]))
{
$img_path = './images/polusfera/'.$row1["image"];
$max_width = 300;
$max_height = 300;
list($width, $height) = getimagesize($img_path);
$ratioh = $max_height/$height;
$ratiow = $max_width/$width;
$ratio = min($ratioh, $ratiow);
$width = intval($ratio*$width);
$height = intval($ratio*$height);
}else
{
$img_path = "/images/no-image.png";
$width = 110;
$height = 200;
}
// Количество отзывов
//$query_reviews = mysql_query("SELECT * FROM table_reviews WHERE products_id = '$id' AND moderat='1'",$link);
//$count_reviews = mysql_num_rows($query_reviews);
echo '
<div id="block-breadcrumbs-and-rating">
<p id="nav-breadcrumbs2"><a href="view_cat.php?type=polusfera">Полусферы</a> \ <span>'.$row1["brand"].'</span></p>
</div>
<div id="block-content-info">
<img src="'.$img_path.'" width="'.$width.'" height="'.$height.'" />
<div id="block-mini-description">
<p id="content-title">'.$row1["title"].'</p>
<ul class="reviews-and-counts-content">
<li><img src="/images/eye-icon.png" /><p>'.$row1["count"].'</p></li>
</ul>
<p id="style-price" >'.group_numerals($row1["price"]).' руб</p>
<p id="content-text">'.$row1["mini_description"].'</p>
</div>
</div>
';
}
while ($row1 = mysql_fetch_array($result1));
$result = mysql_query("SELECT * FROM uploads_images WHERE products_id='$id'",$link);
If (mysql_num_rows($result) > 0)
{
$row = mysql_fetch_array($result);
echo '<div id="block-img-slide">
<ul>';
do
{
$img_path = './uploads_images/'.$row["image"];
$max_width = 70;
$max_height = 70;
list($width, $height) = getimagesize($img_path);
$ratioh = $max_height/$height;
$ratiow = $max_width/$width;
$ratio = min($ratioh, $ratiow);
$width = intval($ratio*$width);
$height = intval($ratio*$height);
echo '
<li>
<a class="image-modal" href="#image'.$row["id"].'"><img src="'.$img_path.'" width="'.$width.'" height="'.$height.'" /></a>
</li>
<a style="display:none;" class="image-modal" rel="group" id="image'.$row["id"].'" ><img src="./uploads_images/'.$row["image"].'" /></a>
';
}
while ($row = mysql_fetch_array($result));
echo '
</ul>
</div>
';
}
$result = mysql_query("SELECT * FROM table_products WHERE products_id='$id' AND visible='1'",$link);
$row = mysql_fetch_array($result);
}
?>
</div>
<?php
include("include/block-footer.php");
?>
</div>
</body>
</html>
ЗАРАНЕЕ БЛАГОДАРЮ