mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 08:38:11 +00:00
34 lines
845 B
HTML
34 lines
845 B
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<script src="js/jquery.min.js"></script>
|
|
<script src="../jspsych.js"></script>
|
|
<script src="../plugins/jspsych-xab.js"></script>
|
|
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
|
<style>
|
|
img { width: 300px; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="jspsych-target"></div>
|
|
</body>
|
|
<script>
|
|
|
|
var block = {
|
|
type: 'xab',
|
|
stimuli: [['img/happy_face_1.jpg', 'img/happy_face_2.jpg']],
|
|
prompt: "<p class='center-content'>Press Q if the face you just saw is on the left. Press P if the face you just saw is on the right.</p>"
|
|
}
|
|
|
|
function start(){
|
|
jsPsych.init({
|
|
display_element: $('#jspsych-target'),
|
|
experiment_structure: [block]
|
|
});
|
|
}
|
|
|
|
jsPsych.preloadImages(['img/happy_face_1.jpg','img/happy_face_2.jpg'], start);
|
|
|
|
</script>
|
|
</html>
|