Skip to content

Instantly share code, notes, and snippets.

@jakewilliami
Created April 27, 2021 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakewilliami/40b3611b1241a53e1350677dd281e60b to your computer and use it in GitHub Desktop.
Save jakewilliami/40b3611b1241a53e1350677dd281e60b to your computer and use it in GitHub Desktop.
SM.addState(State.FixationCross, {
onEnter: (machine: stateMachine.Machine, blockStruct: BlockStruct) => {
gorilla.populate('#gorilla', 'fixation', {});
$('#gorilla')
.delay(beforeFixationDelay)
.queue(function () {
$('.fixation-cross').show();
gorilla.refreshLayout();
$(this).dequeue();
})// end queue for '#gorilla'
.delay(fixationLength)
.queue(function () {
$('.fixation-cross').hide();
gorilla.refreshLayout();
$(this).dequeue();
}) // end queue for '#gorilla'
.delay(afterFixationDelay)
.queue(function () {
// this must be in here, as if I transition outside of the queue, it will not display correctly
machine.transition(State.SubTrial, blockStruct);
$(this).dequeue();
}); // end queue for '#gorilla'
} // end onEnter
}) // end addState State.FixationCross
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment