Hi All,
I need a bit of help if possible? I’ve got a pretty good knowledge of websites, JS, etc.. and I’ve been playing with AJAX for dynamic content within divs on my pages to keep away from refreshing entire pages, etc..
The problem.
My website is for my photography. I have a static gallery (php) page within which I populate 1 DIV with dynamic html (an image tag, a few links, text, etc..) this works without fail.. Also… in this static page I have a DIV called AITrigger which is a simple CSS rollover image and tied to a jquery.click event to popup a div to present a purchase photo window. This works too..
BUT I want the clickable AITrigger in the dynamic section since it varies in parameters, etc… so the AITrigger definition is in a CSS file, the query references to it are in the static gallery page and the actual AITrigger div is presented via AJAX.
When I move the DIV AITrigger into the ajax callback and the AJAX presents the DIV dynamically then the jquery in the local document doesn’t work. in fact I can use anything – doesn’t have to be jquery, I’ve used bump box, lightbox, standard <A> tags, etc.. and none of them work once the call is made from the ajax code. move the code back onto the main document and it works..
From my limited knowledge of the document structure I was thinking that the AJAX code doesn’t exist at the time the main document is put together, therefore when the ajax code and links arrive they can’t see the document or its content to call or reference them.
Have I made sense here? its been bugging me for ages and I hoped someone could point me in a rough direction that I can figure out whats going on..
MANY THANKS
Richard