0

I'm trying to use Prototype's Ajax.PeriodicalUpdater to scroll through/display an array of items on an interval. So far I've managed to make it display a new item every 2 seconds, but it only works in Firefox. Haven't tested in Safari or Opera yet...but I know it doesn't work in IE6. It can be seen below here:

http://squarebox.org/sandbox/comment_slide/

on the index.php page, I have this script written:

Event.observe(window, 'load', function() {
	new Ajax.PeriodicalUpdater('comment_slider', 'comment_slider_ajax.php', {
		method: 'post', 
		frequency: 2,
		onSuccess: function(){ new Effect.Fade('comment_div', { duration:0.3 }) },
		insertion: 'top',
	});
});

function showComment(divId){
	new Effect.SlideDown(divId, { duration:0.3 });
}

showComment() is called in comment_slider_ajax.php, which displays the "comment_div" and calls the showComment() function.

I've searched through some similar issues -- some people seem to experience it, but others confirm that it's working. I've seen some users say that the object only fires the AJAX request once, then stops working.

Anyone have any ideas?

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by ~s.o.s~
0

Queries related to Javascript libraries like Prototype are better asked in the specific forums (unless you already haven't asked it there!) since there might be many out there who would have faced a similar problem and hence is one of the fastest way of getting help.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.