PDA

View Full Version : dynamic ajax content and lightbox still not working



hcvitto
04-26-2007, 04:14 PM
1) Script Title: Dynamic Ajax Content

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm

3) Describe problem: hi
iíve been trying to use lightbox from a link in a div loaded via ajax (Dynamic Ajax Content)Öand it doesnít work!
1) i checked tha paths
2) there are no conflicts beween scripts
3) so iím stuck
4) i added the initLightbox() function at the end of the loaded content but still it doesn't work.
any idea? has anyone had similar issues before?


this is tha page i'm workin' on
http://office.azero.it/fitoben.it/prodotti/prodotti.php
(choose something from the first and second select
1 -if you click on the zoom img a lightbox page should open and it doesn't
2 - if you click on the bottle image a (working on its own) index.html page open but it doesn't work in the website)
thanks vitto
thanks

jscheuer1
04-26-2007, 04:40 PM
http://www.dynamicdrive.com/forums/showthread.php?t=17426

hcvitto
04-27-2007, 10:19 AM
hi john
thanks for the quick reply! i followed the instruction and managed to make it work, but only partially. i guess it's a problem with the lightboxGoneWild script so i'm not sure this is the right forum to go on with this..but if you have direct experience about this it could be very useful for me.

As you can see from the page
http://office.azero.it/fitoben.it/prodotti/prodotti.php

the lightboxGoneWild works fine the first time but if i select a different option from a select menu on top the lightbox doesn't work. It's weird because at the moment all the select options call the same page therefore the same script. Any idea about that?
Many thanx again
Vitto

jscheuer1
04-27-2007, 12:57 PM
I don't really see where you are using any of the suggestions from the linked post in your code on the page you linked to. Perhaps I missed it.

In any case, since you are using a select element's onchange event to load the Ajax content, that is where you should set the:

window.acInit=false;


<select id="mainSelection" onchange="window.acInit=false;populateSubSelection()" name="s1">
<option>Visualizza per</option>
<option value="problema">Problematiche</option>
<option value="prodotto">Prodotti</option>
</select>

Then on the inserted content page, the links that fire lytebox (which I couldn't find) or their container should have the mouseover initialization event that also sets:

window.acInit=true;


onmouseover="if(!window.acInit){initLytebox();window.acInit=true;};"

hcvitto
04-27-2007, 02:01 PM
many thanks again!!!
it's weird you can't see the code. If you have firefox you should probably look at the generated code (with the developer bar installed).

Now everything works fine; there's still a couple of things not 100% right but they concern me and the LightboxGoneWild script:).

I really appreciate.
Vitto