...

View Full Version : script.aculo.us Having issues using effect.queues in conjunction with callbacks with script.aculo.us



cd_gary
09-04-2009, 01:09 PM
The below function works perfectly fine, but in my attempt to add a scope queue
to the doSomething2() function so I can give it a scope of 'nbaeffect' like
doSomething3() and apply a limit of 2 to both in order to supress the amount
of effects that are queue, nothingd happens and I'm not generating a javascript
error. Not sure what I'm doing wrong.

This Code works fine but, the modified code that I'm having issues with
is below this code:

function doSomething3(){
new Effect.Fade('logo', {queue: { position: 'end', scope: 'nbaeffect'}});
}

function doSomething2(){
new Effect.Fade('view',
{
afterFinish: function (effect)
{
new Effect.Fade('logo');
doSomething();
}
});
}


function addObservers()
{
$('NBA').observe('change', doSomething3);
$('NBA').observe('change', doSomething2);
}

Event.observe(window, 'load', addObservers);

The issue is with adding an effect queue and scope to doSomething2()

function doSomething3(){
new Effect.Fade('logo', {queue: { position: 'end', scope: 'nbaeffect'}});
}

function doSomething2(){
new Effect.Fade('view', {queue: {position: 'end', scope: 'nbaeffect'}},
{
afterFinish: function (effect)
{
new Effect.Fade('logo');
doSomething();
}
});
}


function addObservers()
{
$('NBA').observe('change', doSomething3);
$('NBA').observe('change', doSomething2);
}

Event.observe(window, 'load', addObservers);

ohgod
09-09-2009, 02:38 PM
i think queue needs to be included in the array of args.... in other words you're closing the brackets to early...

insted of

function doSomething2(){
new Effect.Fade('view', {queue: {position: 'end', scope: 'nbaeffect'}},
{
afterFinish: function (effect)
{
new Effect.Fade('logo');
doSomething();
}
});
}
try

function doSomething2(){
new Effect.Fade('view', {queue: {position: 'end', scope: 'nbaeffect'},
afterFinish: function (effect){
new Effect.Fade('logo');
doSomething();
}
});
}
so basically instead of saying "new Effect.Fade('id', {params});" you were saying "new Effect.Fade('id', {queue},{params});"... which is almost certainly no good.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum