【问题标题】:jsPsych: change button position and stylejsPsych:更改按钮位置和样式
【发布时间】:2020-11-04 18:07:57
【问题描述】:

我正在尝试使用 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;
}

如何以我想要的方式显示按钮?提前非常感谢您!

【问题讨论】:

    标签: javascript html css htmlbutton jspsych


    【解决方案1】:

    更改 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>']
    

    【讨论】:

      猜你喜欢
      • 2020-04-12
      • 1970-01-01
      • 1970-01-01
      • 2016-09-11
      • 2014-12-04
      • 2023-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多