View Full Version : Dynamic Ajax Content & LightboxJS

01-20-2007, 10:34 AM
EDIT: Sorry, just found http://www.dynamicdrive.com/forums/archive/index.php/t-11098.html that describes the same issue..

Dynamic Ajax Content

I have some problem with using the Dynamic Ajax Content when trying to load a gallery made which is using Lightbox.

My problem is that when I load the gallerypage, lightbox needs the following .js files loaded:

<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
and this is done by using

<a href="javascript:ajaxpage('gallery/england2005/default.html', 'mainCont'); loadobjs('css/lightbox.css', 'css/thumbs.css', 'js/prototype.js', 'js/scriptaculous.js?load=effects', 'js/lightbox.js')" class="content">"

Now I have pinned down the problem to the loading of
if this line is removed, the page loads but lightbox doesn't work. Can the Dynamic Ajax Content be modified to support a .js that loads another js?

The page can be found on www.tobiaslolax.nu (gallery link), if you need a look on the sourcecode you will need to use the url www.dirtyworkers.org/tobiaslolax.nu/

Thanks in advance,

01-28-2007, 08:01 AM
I had the same problem, solved like this:

<a href="images/content/image-1.jpg" rel="lightbox" onmousedown="initLightbox()">some link</a>

This line is the link from a page that loads into Dynamic Ajax Content. So just add this to your link onmousedown="initLightbox()"

The page where is used this is: www.concretsolution.ro

01-28-2007, 06:38 PM
Thanks for sharing, but I really had to use that timeout-fix that was talked about in the other thread because I was integrating a gallery made with some freeware and I couldn't go and change the html code that got generated (anf francly, I couldn't start adding the onmousedown() to all the images in my gallery..

The gallery can be found on www.tobiaslolax.nu (and don't laugh at my code) :)