I installed fancybox in my script but for some reason instead of clicking into a popup it just clicks to the location of the image. I am running it through a bit of php code that is generated numerically (based on the information in the database). Thus, there is more than one block of code but its essentially the same code. I just do not know how to get it working any suggestions would be great. My code is below.
<?php
if(isset($_GET['package'])) {
$package = ($_GET['package']);
$arr = array();
$items = "SELECT * FROM ind_products";
$item_list = mysql_query($items);
/*$row = mysql_fetch_array($item_list);*/
while($row = mysql_fetch_array($item_list)) {
$arr = explode(',',$row['packages']);
if (in_array("$package",$arr)) {
echo "<form action=\"\" method=\"post\" class=\"jcart\" >";
echo "<div id=\"itemBox\" align=\"left\">";
$item_name = ($row['item_name']);
$size = ($row['size']);
$description = ($row['description']);
$id = ($row['id']);
$photo = ($row['photo']);
$photo2 = ($row['photo2']);
if ($photo == '') {
$photo = 'images/pph.jpg';
}
if ($photo2 == '') {
$photo2 = 'images/pph2.jpg';
}
if ($description == '') {
$description = 'Description goes here!';
}
echo "<input type=\"hidden\" name=\"my-item-id\" value=\"$id\">";
echo "<input type=\"hidden\" name=\"my-item-name\" value=\"$item_name\">";
echo "<input type=\"hidden\" name=\"my-item-price\" value=\"0.00\">";
echo "<input type=\"hidden\" name=\"my-item-url\" value=\"\">";
echo "<p id=\"info_image\">";
echo "<a id=\"single_1\" href=\"$photo2\">";
echo "<img src=\"crop.php?h=85&w=85&f=$photo\" align=\"left\" alt=\"item images\" />";
echo "</a>";
echo "</p>";
echo "<p id=\"info_box\">";
echo "<span id=\"pro_name\">",$item_name,"</span>",'<br>';
echo "<span id=\"pro_size\">",$size,"</span>",'<br>';
echo "<span id=\"pro_des\">",$description,'<br>';
echo "<span id=\"pro_title\">Quantity</span><input name=\"my-item-qty\" type=\"text\" value=\"1\" size=\"3\" />";
echo "<span id=\"pro_input\"></span><input type=\"submit\" name=\"my-add-button\" value=\"add to inquiry\" class=\"button\" />";
echo "</p>";
echo "<div style=\"clear:both; margin-bottom:0.5em\"></div>";
echo "</div>";
echo "</form>";
}else{
// do nothing for now
/*echo "<form action=\"\" method=\"post\" class=\"jcart\" >";
echo "<div id=\"itemBox\" align=\"left\">";
$item_name = ($row['item_name']);
$size = ($row['size']);
$description = ($row['description']);
$id = ($row['id']);
echo "<span id=\"pro_name\">",$item_name,"</span>",'<br>';
echo "<span id=\"pro_size\">",$size,"</span>",'<br>';
echo "<span id=\"pro_des\">",$description,'<br>';
echo 'There are no products to display!!';
echo "<div style=\"clear:both; margin-bottom:0.5em\"></div>";
echo "</div>";
echo "</form>"; */
}
}
}else{
echo 'The packages are not set';
}
?>
The fancybox code:
$(document).ready(function() {
$("#single_1").fancybox({
helpers: {
title : {
type : 'float'
}
}
});
});
are you sure that all required scripts (jquery + fancybox), and also all additional loaded js-script/code where loaded/initialized without errors?
any occuring javascript-error before the fancybox-setup-call would prevent the successfull initiation of that.