PDA

View Full Version : Lightbox and other scripts dont mingle?



wasahobo
08-15-2006, 09:24 AM
1) Script Title: Light Box 1

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/lightbox/index.htm

3) Describe problem: Not working well with other scripts.

www.3sstudios.com

Thanks alot guys :)

jscheuer1
08-15-2006, 10:06 AM
Well, you could have described the problem in a bit more detail, like which other script(s). Anyways, the main problem lightbox has in combining with other scripts is that it must initialize its links after they have been written to the page. On a normal installation of lightbox, it does this onload of the page. But, since many scripts write and/or rewrite links to a page as a normal part of their operation, lightbox must be reinited after each action of this sort that involves its links.

What I usually do is find a spot in the other script just after said links have been written to the page (not just to some variable for later use) and put this short line in:


initLightbox();

There can be other considerations but, as long as there is no onload conflict or shared object/function/variable names between the two scripts and the other script has been modified (if applicable) to write the light box style of link, it will almost always work.

vik007
09-06-2006, 10:39 PM
1) Script Title: Light Box 1

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tbox/index.htm



Hi i am using the lightbox coding, and i think there is a conflict.

the page in connection is: http://www.splay.co.uk/PRODUCTS/Cricket-Balls-club3.htm

The link is at the bottom of the page.



But i think it is conflicting becuase it works on a new blank page http://www.splay.co.uk/new7.htm



i am guessing i have got 2 many scripts aswell...can someone lead me the right way to knowing which ones i can delete safely? thanks in advanced

jscheuer1
09-07-2006, 06:06 AM
http://www.splay.co.uk/PRODUCTS/js/prototype.js
http://www.splay.co.uk/PRODUCTS/js/scriptaculous.js?load=effects
http://www.splay.co.uk/PRODUCTS/js/lightbox.js

These files are all missing. There could be other problems.

vik007
09-07-2006, 12:15 PM
Brilliant...worked perfectly:-)

I was basically going wrong because those files were not in the Products folder. didnt think to put them there becuase i thought they are in the main root anyway....ohhh well

thanks for your help

vik007
09-07-2006, 11:09 PM
Hi got a slight problem.

Iv basically pasted the coding in the top on a new page..(in the same folder as the products)

iv also pasted the same coding, to a new page...the window opens, but only the one picture pops up?

When checked in the html coding, the coding only seems to show just the one.

Iv tried to enter in the coding again, for th 2nd pix, but still the one pix only opens.

You can check it out here.

http://www.splay.co.uk/PRODUCTS/healthandfitness-acupressuremat2.htm

it is a bit weird, cuz the lightbox pop up opens in frontpage preview, but when uploaded, it doesnt??

thanks

jscheuer1
09-08-2006, 06:33 AM
One thing I can tell you is that your vml is preventing lightbox from working at all in Opera or FF. The ball and the vml effects get displayed but the link is not clickable. But to get it to work with the other balls in IE:


<!--[if gte vml 1]><v:rect id="_x0000_s1062"
alt="" style='width:141.75pt;height:132pt' strokecolor="#969696">
<v:shadow on="t" opacity=".5" offset="6pt,6pt"/>
<v:textbox>
<table cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr>
<td align="center">
<a href="../Stock%20Pictures/Footballs/splayband.jpg" rel="lightbox[roadtrip]">
<img src="../Stock%20Pictures/Footballs/splayband.jpg" width="100" height="97" alt /></a>
<a href="../Stock%20Pictures/Footballs/splayclub.jpg" rel="lightbox[roadtrip]"></a>
<a href="../Stock%20Pictures/Footballs/splaystripe.jpg" rel="lightbox[roadtrip]"></a>
</a></td>
</tr>
</table>
</v:textbox>
</v:rect><![endif]-->

Notes: I'd suggest dropping the vml so it can work in other browsers.