PDA

View Full Version : Lightbox 2 problem


GavinBurns
01-18-2010, 10:35 AM
Hi all
I apologies if this has been asked before I can't find it through the forum.
I'm trying to add the lightbox 2 gallery to my site and it doesn't work properly. I'm trying on a page called gallery.html however when i try the exact same procedure on a new site and use index.html it works fine. I deleted the index.html file that comes with lightbox 2. Do i need to change something from index.html to gallery.html in the script?
Thanks

gentleone
01-18-2010, 10:46 AM
Can you provide us the code or do you have a link to the page?

GavinBurns
01-18-2010, 11:05 AM
Hi gentleone
The site isnt live yet I dont have a domain as yet for it. What code do you mean?

gentleone
01-18-2010, 11:52 AM
Hi gentleone
The site isnt live yet I dont have a domain as yet for it. What code do you mean?

The HTML and CSS from gallery.html.

GavinBurns
01-18-2010, 12:22 PM
Hi Gentleone
Heres the code. Please bare in mind I have never done anything in code before!
<head>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="../Scripts/swfobject_modified.js" type="text/javascript"></script>
<style type="text/css">
td img {display: block;}
.Gallery {
font-size: 24px;
font-family: Arial, Helvetica, sans-serif;
color: #F00;
}
</style>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
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];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('images/NavbarDSM_r1_c1_f2.jpg','images/NavbarDSM_r1_c2_f2.jpg','images/NavbarDSM_r1_c3_f2.jpg','images/NavbarDSM_r1_c4_f2.jpg','images/NavbarDSM_r1_c5_f2.jpg','images/NavbarDSM_r1_c6_f2.jpg')">
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#1B1A1A"><table width="100%" border="0" cellspacing="3" cellpadding="3">
<tr>
<td width="32%" bgcolor="#1B1A1A"><a href="index.html"><img src="images/logo.png" alt="DSM logo" width="210" height="120" border="0" /></a></td>
<td width="68%" bgcolor="#1B1A1A"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="500" height="100" id="FlashID" title="DSM Flash head">
<param name="movie" value="images/DSM-Doncaster-Motorcycle-Training-CBT-flash.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you donít want users to see the prompt. -->
<param name="expressinstall" value="../Scripts/expressInstall.swf" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="images/DSM-Doncaster-Motorcycle-Training-CBT-flash.swf" width="500" height="100">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<param name="expressinstall" value="../Scripts/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="

gentleone
01-18-2010, 01:12 PM
There is a crucial part missing in your code... the gallery ;)

It's because you didn't post your code in between the code tags. Use the 'POST REPLY' button instead of 'Quick Reply' and choose first the # in the menu at the top of the editor and then paste your code.

GavinBurns
01-18-2010, 01:28 PM
Sorry :confused:
<!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>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="../Scripts/swfobject_modified.js" type="text/javascript"></script>
<style type="text/css">
td img {display: block;}
.Gallery {
font-size: 24px;
font-family: Arial, Helvetica, sans-serif;
color: #F00;
}
body {
background-image: url(images/DSM-Doncaster-motorcycle-training-cbt-background2.jpg);
background-repeat: repeat-x;
background-color: #F5F0DA;
font-size: 9px;
}
</style>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
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];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('images/NavbarDSM_r1_c1_f2.jpg','images/NavbarDSM_r1_c2_f2.jpg','images/NavbarDSM_r1_c3_f2.jpg','images/NavbarDSM_r1_c4_f2.jpg','images/NavbarDSM_r1_c5_f2.jpg','images/NavbarDSM_r1_c6_f2.jpg')initLightbox()">
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#1B1A1A"><table width="100%" border="0" cellspacing="3" cellpadding="3">
<tr>
<td width="32%" bgcolor="#1B1A1A"><a href="index.html"><img src="images/logo.png" alt="DSM logo" width="210" height="120" border="0" /></a></td>
<td width="68%" bgcolor="#1B1A1A"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="500" height="100" id="FlashID" title="DSM Flash head">
<param name="movie" value="images/DSM-Doncaster-Motorcycle-Training-CBT-flash.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall" value="../Scripts/expressInstall.swf" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="images/DSM-Doncaster-Motorcycle-Training-CBT-flash.swf" width="500" height="100">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" />
<param name="expressinstall" value="../Scripts/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="

GavinBurns
01-18-2010, 01:37 PM
Hi Gentleone
It works now I had moved my images folder and dreamweaver hadn't picked up on it untill I restarted it.
Thank you very much for your time

gentleone
01-18-2010, 01:39 PM
Uhm... still no good! open with code tag and close with code tag.

gentleone
01-18-2010, 01:40 PM
okay... all good!