Need a little help with JQuery Lightbox simple function

Regarding: http://www.chmi.com/300hingesBU.php 

I'm having difficulty getting Lightbox to work. Got it from http://leandrovieira.com/projects/jquery/lightbox/

It will actually work when I use:  $('a').lightBox(); // Select all links in the page

but it also makes ANY link on the page want to use lightbox, not just the images.
<?php require_once('Connections/CHMIdb.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
mysql_select_db($database_CHMIdb, $CHMIdb);
$query_Recordset1 = "SELECT * FROM all_products WHERE category_id = 76 ORDER BY all_products.partnumber";
$Recordset1 = mysql_query($query_Recordset1, $CHMIdb) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?><!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CHMI .:Custom Hardware Manufacturing, Inc. 300 Series Hinges</title>
<link href="css/styles.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery.lightbox-0.5.js"></script>
    <link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" />
<style type="text/css">
<!--
#entirebody {
	width:800px;
	position: absolute;
	padding: 0px;
	margin: 0;
	left: 0px;
	top: 0px;
	height: 93px;
}
html {
	overflow-x: hidden;
}
#header {
	position: absolute;
	left: 0px;
	top: 0;
}
body {
	margin-top: 0px;
	margin-left: 0px;
}
#archbutton {
	position: absolute;
	left: 68px;
	top: 303px;
}
#bathbutton {
	position: absolute;
	left: 404px;
	top: 302px;
}
#title {
	position: absolute;
	left: 43px;
	top: 153px;
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 24px;
	font-style: normal;
	width: 293px;
	height: 41px;
}
#homenav {
	position: relative;
	width: 325px;
	height: 26px;
	top: 300px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	left: 400px;
}
#horline {
	border-top-width: thin;
	border-right-width: thin;
	border-bottom-width: thin;
	border-left-width: thin;
	border-top-style: groove;
	border-top-color: #000000;
	border-right-color: #000000;
	border-bottom-color: #000000;
	border-left-color: #000000;
	position: absolute;
	width: 1896px;
	left: -405px;
	top: -25px;
	height: -1px;
}
#prodtitle {
	position: absolute;
	left: 13px;
	top: 70px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
}
#proddescription {
	position: relative;
	left: 5px;
	top: 5px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	width: 250px;
	height: 400px;
	overflow: auto;
}
#proddesc2 {
	position: relative;
	left: 0px;
	top: 15px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
}
.style1 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-style: normal;
}
#imageArchHandles {
	position: absolute;
	left: 58px;
	top: 306px;
}
#archhandlestext {
	position: absolute;
	left: 78px;
	top: 530px;
	width: 235px;
	height: 24px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12pt;
}
#archmainimages {
	position: absolute;
	left: 122px;
	top: 275px;
}
#bodytext {
	position: relative;
	left: 198px;
	top: 575px;
	width: 357px;
	height: 25px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14px;
}
#photo1 {
	position: absolute;
	left: 223px;
	top: 293px;
	width: 283px;
	height: 114px;
}
#parts {
	position: relative;
	left: 45px;
	top: 200px;
	width: 500px;
	border-right-width: 1px;
	border-right-color: #000066;
	border-right-style: solid;
	margin: 0px;
	padding: 0px;
	border-top-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	border-top-color: #000066;
	border-bottom-color: #000066;
	border-left-color: #000066;
	height: 500px;
}
#slogan {
	position: absolute;
	left: 23px;
	top: -23px;
	width: 364px;
}
#partnumber {
	position: absolute;
	left: 7px;
	top: 11px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	width: 100px;
	font-weight: bold;
}
#prodimage {
	height: 200px;
	width: 200px;
	position: relative;
	border: 1px solid #999999;
	left: 275px;
	top: 5px;
}
#prodfeatures {
	position: absolute;
	left: 494px;
	top: -13px;
}
#prodtechinfo {
	position: absolute;
	left: 344px;
	top: 214px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
#transparentgif {
	position: relative;
	left: 400px;
	top: -100px;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
 
<script type="text/javascript" language="JavaScript1.2" src="navincludes/stmenu.js"></script>
 
<script type="text/javascript">
    $(function() {
        $('a').lightBox();
    });
    </script>
    
</head>
 
<body>
<div id="entirebody">
  <div id="header">
  <embed src="images/HeaderAddress.swf" width="1595" height="100"></embed>
  </div>
  <div class="navbar" id="navbar">
  <?php include("navincludes/navbar.html"); ?></div>
  <div class="title style1" id="title">CHMI 300 Series Hinges</div>
 
  
  
  
  <table >
    <tr>
      <?php
$Recordset1_endRow = 0;
$Recordset1_columns = 2; // number of columns
$Recordset1_hloopRow1 = 0; // first row flag
do {
    if($Recordset1_endRow == 0  && $Recordset1_hloopRow1++ != 0) echo "<tr>";
   ?>
      <td><div id="parts">
          <div id="prodimage"><a href="images/<?php echo $row_Recordset1['product_image']; ?>"  $('#gallery a').lightBox();"><img src="images/<?php echo $row_Recordset1['product_image']; ?>" width="200" height="200" border="0" /></a></div>
        <br /><div id="prodtitle"><?php echo $row_Recordset1['product_title']; ?><div id="proddescription"><?php echo $row_Recordset1['description']; ?><div id="pproddesc2"><?php echo $row_Recordset1['description2']; ?><br /><?php echo $row_Recordset1['features']; ?><br /><?php echo $row_Recordset1['addtl_info']; ?></div></div></div>
          <div id="partnumber"><?php echo $row_Recordset1['partnumber']; ?></div>
        <br />
        <br />
          <br />
          <br /><div id="prodtechinfo"><a href="documents/<?php echo $row_Recordset1['techinfo']; ?>" target="_blank">Download PDF</a></div>
      </div></td>
      <?php  $Recordset1_endRow++;
if($Recordset1_endRow >= $Recordset1_columns) {
  ?>
    </tr>
    <?php
 $Recordset1_endRow = 0;
  }
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
if($Recordset1_endRow != 0) {
while ($Recordset1_endRow < $Recordset1_columns) {
    echo("<td>&nbsp;</td>");
    $Recordset1_endRow++;
}
echo("</tr>");
}?>
  </table>
  <div id="homenav">
            
            
            <?php include("includes/homenav.html"); ?>
  <div id="horline"></div>
  </div>
</div>
 
<div id="slogan">CHMI Products are the finest in the industry!</div>
    
</div>
  
 
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

Open in new window

LVL 1
edvinsonAsked:
Who is Participating?
 
bored321Connect With a Mentor Commented:
try

<script type="text/javascript">
    $(function() {
        $('#prodimage a').lightBox();
    });
</script>

Open in new window

0
 
edvinsonAuthor Commented:
OH YEAH!!!!!!!!!  Thank you!

e!
0
 
edvinsonAuthor Commented:
please see a new question I made about this.  thanks
0
All Courses

From novice to tech pro — start learning today.