我正在尝试使用jsPsych html-button-response插件(https://www.jspsych.org/plugins/jspsych-html-button-response/)显示两个按钮。我使用图片作为按钮,而不是文本。我在“选项:”选项中将它们指定为choices: ["<img src='" + ButtonLeft+ "'>", "<img src='" + ButtonRight+ "'>"],。
默认情况下,按钮在我的刺激下居中显示。相反,我想把它们显示在我的刺激之上(它依次由一堆重叠的图像组成-一个背景+一些项目),一个在左边,另一个在右边,在相对于我的背景的特定位置。按钮的默认样式为:
.jspsych-btn {
display: inline-block;
padding: 6px 12px;
margin: 0px;
font-size: 14px;
font-weight: 400;
font-family: 'Open Sans', 'Arial', sans-serif;
cursor: pointer;
line-height: 1.4;
text-align: center;
white-space: nowrap;
vertical-align: middle;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
color: #333;
background-color: #fff;
border-color: #ccc;
}如何才能以我想要的方式显示这些按钮?提前谢谢你!
发布于 2020-07-17 20:42:05
更改button_html参数就做到了!
button_html: ['<button class="jspsych-btn" style = "position:absolute; left:284.5px; top: 270px">%choice%</button>', '<button class="jspsych-btn" style = "position:absolute; right:284.5px; top: 270px">%choice%</button>']https://stackoverflow.com/questions/62911543
复制相似问题