Solved

Need a little help with JQuery Lightbox simple function

Posted on 2009-05-18
3
411 Views
Last Modified: 2013-12-12
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

0
Comment
Question by:edvinson
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
bored321 earned 500 total points
ID: 24416565
try

<script type="text/javascript">

    $(function() {

        $('#prodimage a').lightBox();

    });

</script>

Open in new window

0
 
LVL 1

Author Closing Comment

by:edvinson
ID: 31582778
OH YEAH!!!!!!!!!  Thank you!

e!
0
 
LVL 1

Author Comment

by:edvinson
ID: 24417437
please see a new question I made about this.  thanks
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now