我的滑块占据了整个屏幕,我该怎么办

时间:2019-01-21 18:55:51

标签: html css twitter-bootstrap web slider

我想将滑块用作800 x 400的横幅图片,但是当我要测试这是我编写的代码时,滑块正在全屏显示,我将在哪里编写尺寸?

outer_loop:

for (let i = 0; i < varifiedKeypoints.length; i++) {

  let initialKeypoint = varifiedKeypoints[i];

  for (let j = 0; j < varifiedKeypoints.length; j++) {

    let comparisonKeypoint = varifiedKeypoints[j];

    if (initialKeypoint.part != comparisonKeypoint.part) {

      if (Math.abs(comparisonKeypoint.position.x - initialKeypoint.position.x) <= 20
      && Math.abs(comparisonKeypoint.position.y - initialKeypoint.position.y) <= 20) {

        if (keypointsCompatible(initialKeypoint.part, comparisonKeypoint.part)) {

          console.log("Activating part: " + initialKeypoint.part);
          console.log("Activated part: " + comparisonKeypoint.part);

          let keypointPair = {
            point_1: initialKeypoint.part,
            point_2: comparisonKeypoint.part
          }

          console.log("Pushing parts!");
          activeParts.push(keypointPair);

          console.log("breaking loop!");
          break outer_loop;

          console.log("Loop broken - NOT!!!")
        }
      }
    }
  }
}

1 个答案:

答案 0 :(得分:0)

您将需要使用CSS来执行此操作,我认为Bootstrap与无法在HTML中工作有关。

.carousel .item {
  width: 800px;
  height: 400px;
}