Recent Posts by dward
|
Feb 23, 2008
|
Topic: Carousel / Help with ajax carousel Thanks for the quick reply! Now I have a clearer picture of what I should do now. |
|
Feb 22, 2008
|
Topic: Carousel / Help with ajax carousel Hi, I’m pretty new to this whole ajax stuff. I only have about a month of ajax experience and…well, let’s just say my project requires me to use the carousel. I managed to get the normal, static carousel working, but there are pages that requires me to use ajax to insert contents into the carousel instead.
var carousel = null;
function runTest() {
updateCarouselSize();
carousel = new UI.Ajax.Carousel("horizontal_carousel", {url: "../../fixtures/ajax_carousel_content.html", elementSize: 250})
.observe("request:started", function() {
$('spinner').show().morph("opacity:0.8", {duration:0.5});
})
.observe("request:ended", function() {
$('spinner').morph("opacity:0", {duration:0.5, afterFinish: function(obj) { obj.element.hide(); }});
});
}
The above script is taken from the example included in the download package. Alright, here’s my questions. I insert the address of my server-side script into the url right? Then what about the elementSize? It says in the documentation page that the elementSize refers to the size of all elements, but how am I to know the size of all my elements in the first place? Do I have to perform some calculation beforehand? I’m dealing with a possibly huge database here so I need to ensure that the whole carousel is manageable. Now for my next question…..my project is written entirely using java (jsps and servlets), so aside from inserting the address of my servlet into the url field, my servlet will have to be written to return something for the ajax carousel to handle right? So my question is, do I return the whole string of ”< li >......< /li >”, or is there some sort of format that I have to adhere to? I had used prototype js before to handle JSON messages returned from my servlet so I was wondering if this will be any different. Can any kind soul please reply to me ASAP? I need this piece of information urgently as I’ll be reaching my project dateline in a week time. |