jQuery Shapeshift插件。元素不适合行

时间:2017-02-15 22:58:29

标签: javascript jquery css drag-and-drop

我遇到了jQuery Shapeshift插件的问题。我希望在一行中有蓝色,绿色和黄色的块,但Shapeshift不适合。问题在哪里,我该如何解决?

HTML:

<div class="container">
  <div class="klocek1"></div>
  <div class="klocek2"></div>
  <div class="klocek3"></div>
  <div class="klocek4"></div>
</div>

CSS:

.container {
  border: 1px dashed #ccc;
  position: relative;
  width: 100%;
}

.container .ss-placeholder-child {
  background: transparent;
  border: 1px dashed red;
}

.klocek1 {
  width: 600px;
  height: 600px;
  background: yellow;
  position: absolute;
}

.klocek2 {
  width: 600px;
  height: 300px;
  background: red;
  position: absolute;
}

.klocek3 {
  width: 300px;
  height: 600px;
  background: green;
  position: absolute;
}

.klocek4 {
  width: 300px;
  height: 600px;
  background: blue;
  position: absolute;
}

JS:

$(".container").shapeshift({
  minColumns: 1
});

的jsfiddle: http://jsfiddle.net/odu70g2t/2/

1 个答案:

答案 0 :(得分:0)

我认为你应该相应地安排mininum colums属性,例如在我设置minumum colums时我的屏幕,它正确填充行。 如下:

$(".container").shapeshift({
  minColumns: 3
});

我希望这会有所帮助