PDA

View Full Version : Urgent help needed: Lightbox script conflict!



malihash
05-16-2008, 01:48 PM
on my pages i have dhtml applied to some buttons, and then inserted the lightbox script for a gallery, for some odd reason lightbox isnt working correctly. the code is pasted below: can anyone help PLEASE :(

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Fashion</title>
<link rel="stylesheet" href="lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="lightbox.js"></script>
<script language="JavaScript" fptype="dynamicanimation">
<!--
function dynAnimation() {}
function clickSwapImg() {}
//-->
</script>
<script language="JavaScript1.2" fptype="dynamicanimation" src="animate.js">
</script>
</head>

<body bgcolor="#000000" onload="dynAnimation()" language="Javascript1.2">

malihash
05-16-2008, 02:47 PM
the page can be found at the below link,

http://www.lumieres.biz/Fashion.htm

the lightbox seems to work in opera browser but not in Internet explorer?

Please Help

thanks
Mel

jscheuer1
05-16-2008, 03:27 PM
I want to make this clear to anyone reading this that this advice applies only to the 'original' circa 2006 version of lightbox (before version 2). Later versions 'play nice' with other onload events.

That's because Opera sees window.onload="something" and <body onload="whatever_else" . . . > as two separate events. All other browsers that I am aware of do not, so the second one (in this case the body event) cancels the first one.

Now, in this version of lightbox, at the end of lightbox.js we have:


addLoadEvent(initLightbox); // run initLightbox onLoad

which was meant to, but often fails to 'play nice' with other onload events, may be commented out:


//addLoadEvent(initLightbox); // run initLightbox onLoad

and then added to the body onload event (in this case, addition red):


<body bgcolor="#000000" onload="dynAnimation();initLightbox();" language="Javascript1.2">

The highlighted language attribute is invalid for the body tag, and deprecated in its use elsewhere, so should be removed.

malihash
05-16-2008, 05:35 PM
Thanks so much!
its fixed that issue...

just another small problem, all my thumbnails, when in explorer, seem to have a blue border around them, which i understand indicates the hyperlink, any way of changing the colour or to remove the border?

thanks once again
Mel

jscheuer1
05-16-2008, 06:04 PM
To get rid of the border:


<a href="images/folio/Fashion/f1.jpg" rel="lightbox" ><img border=0 src="images/folio/Fashion/f1_small.jpg" width="33" height="50" /></a>

To change its color:


<a href="images/folio/Fashion/f1.jpg" rel="lightbox" ><img style="border-color:black;" src="images/folio/Fashion/f1_small.jpg" width="33" height="50" /></a>

Depending upon the rest of your page, it might just be easiest to put this in the head:


<style type="text/css">
a img {
border:none;
}
</style>

That will get rid of the border on all linked images on the page. Other border styles or other styles may be used, see:

http://www.eskimo.com/~bloo/indexdot/css/propindex/all.htm

or your favorite style reference.

malihash
05-20-2008, 12:33 PM
Thanks once again, both problems solved, site's now up and running :)
Mel