jsPsych/examples/jspsych-animation.html
2021-02-19 18:20:26 -08:00

40 lines
1.0 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-animation.js"></script>
<script src="../plugins/jspsych-preload.js"></script>
<link rel="stylesheet" href="../css/jspsych.css">
</head>
<body></body>
<script>
var preload_trial = {
type: 'preload',
auto_preload: true
}
// If render_on_canvas is false, the images will be shown via an <img> rather than <canvas> element.
// In some browsers, the first time the images are shown, the <img> method (render_on_canvas: false) will produce a brief
// blank screen (white flash) between images when frame_isi is 0.
var animation_trial = {
type: 'animation',
stimuli: ['img/happy_face_1.jpg', 'img/happy_face_2.jpg', 'img/happy_face_3.jpg', 'img/happy_face_4.jpg'],
sequence_reps: 3,
frame_time: 300,
prompt: '<p>Watch the faces.</p>',
//render_on_canvas: false
};
jsPsych.init({
timeline: [preload_trial, animation_trial],
on_finish: function() {
jsPsych.data.displayData();
}
});
</script>
</html>