PDA

View Full Version : cMotion Image Gallery with Ajax/PHP to get images



steveram
08-26-2008, 08:09 PM
1) CMotion Image Gallery

2) hhttp://www.dynamicdrive.com/dynamicindex4/cmotiongallery.htm

3) Describe problem: When I try to dynamically get the images to put into the <nobr id = "trueContainer"> tag the scrolling stops working. However when the image tags are hard coded in it works fine. I'm using a php script to query a database and get the image paths. I then use a XMLHttpRequest to run this php script and set the innerHTML of the nobr tag to contain the proper images.

My php script echoes "<a href = "#"><img src = "imagepath"></img></a> and then in my ajaxFunction I set document.getElementById('trueContainer') = ajaxRequest.responseText.

I get all the images properly displayed however the scrolling functionality disapears.

I tried searching the forums and tried many things but can't figure it out. Anyone have any advice or a better way to implement it?

Thanks

-Steve

steveram
08-26-2008, 10:37 PM
Update:

In Firefox when I hover over the images Firebug gives me this error:

"Permission denied to get property XULElement.parentNode"

and it refers to this line in the motiongallery.js file:

function contains_ns6(a, b) {
if (b!==null)
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}


:confused:

steveram
09-02-2008, 09:46 PM
anyone? I think some javascript files are conflicting with each other. I might have to start over from scratch.