首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jsPsych:更改按钮位置和样式

jsPsych:更改按钮位置和样式
EN

Stack Overflow用户
提问于 2020-07-15 17:18:31
回答 1查看 707关注 0票数 2

我正在尝试使用jsPsych html-button-response插件(https://www.jspsych.org/plugins/jspsych-html-button-response/)显示两个按钮。我使用图片作为按钮,而不是文本。我在“选项:”选项中将它们指定为choices: ["<img src='" + ButtonLeft+ "'>", "<img src='" + ButtonRight+ "'>"],

默认情况下,按钮在我的刺激下居中显示。相反,我想把它们显示在我的刺激之上(它依次由一堆重叠的图像组成-一个背景+一些项目),一个在左边,另一个在右边,在相对于我的背景的特定位置。按钮的默认样式为:

代码语言:javascript
复制
 .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;
}

如何才能以我想要的方式显示这些按钮?提前谢谢你!

EN

回答 1

Stack Overflow用户

发布于 2020-07-17 20:42:05

更改button_html参数就做到了!

代码语言:javascript
复制
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>']
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62911543

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档