Hello,
Here is my problem
I have two arrays 'liens' and 'ids'.
The first array contains links that have to be loaded in the second
array which contains ids
liens[0] must be loaded in ids[0], liens[1] ... ids [1], etc...
When clicking on a link, all these are supposed to be loaded in their
corresponding ids
here is my code :
for (j=0;j<liens.length;j++)
{
$('#'+ids[j]).slideUp("slow",function()
{
$('#'+ids[j]).load(liens[j] ,function()
{
$('#'+ids[j]).slideDown("slow");
});
});
}
But this is not working, the ids slideUp, but it stop there.
I also tried :
for (j=0;j<liens.length;j++)
{
var myid='#'+ids[j];
(myid).slideUp("slow",function()
{
$.ajax({
url: liens[j],
success: function(data)
{
$('#primaryContentContainer').html(data);
$(myid).slideDown("slow");
}
});
}
}
and :
for (j=0;j<liens.length;j++)
{
var myid='#'+ids[j];
$(myid).slideUp("slow",{onComplete:function()
{
$(myid).load(liens[j] ,{onComplete:function()
{
$(myid).slideDown("slow");
}});
}});
}
Same result, slideUp and stop. It seems that the callback never
occurs.
When i do it this way :
for (j=0;j<liens.length;j++)
{
$('#'+ids[j]).load(liens[j]);
}
It's works fine, so i can load all the ids, but not use effects.
What do i wrong? I'm a beginner, I need expert help for this, thanks.
Krafton