通过集结号游戏动态内容

设定

使用此设置,所有内容都来自外部文件 data.json。 为了使这些东西正常工作,请准备具有适当结构的集结号游戏文件(请参阅下面的集结号游戏)。

{
  "owl" : [
      {"item" : "your html content..."},
      {"item" : "your html content..."},
      ...
  ]
}
            
$(document).ready(function() {

  $("#owl-demo").owlCarousel({
    jsonPath : "json/data.json" 
  });

});
<div id="owl-demo" class="owl-carousel owl-theme">
</div>
#owl-demo .item{
  background: #a1def8;
  padding: 30px 0px;
  display: block;
  margin: 5px;
  color: #FFF;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  text-align: center;
}

{
  "owl" : [
      {"item" : "<span class='item'><h1>1</h1></span>"},
      {"item" : "<span class='item'><h1>2</h1></span>"},
      {"item" : "<span class='item'><h1>3</h1></span>"},
      {"item" : "<span class='item'><h1>4</h1></span>"},
      {"item" : "<span class='item'><h1>5</h1></span>"},
      {"item" : "<span class='item'><h1>6</h1></span>"},
      {"item" : "<span class='item'><h1>7</h1></span>"},
      {"item" : "<span class='item'><h1>8</h1></span>"},
      {"item" : "<span class='item'><h1>9</h1></span>"},
      {"item" : "<span class='item'><h1>10</h1></span>"},
      {"item" : "<span class='item'><h1>11</h1></span>"},
      {"item" : "<span class='item'><h1>12</h1></span>"},
      {"item" : "<span class='item'><h1>13</h1></span>"},
      {"item" : "<span class='item'><h1>14</h1></span>"}
  ]
}

更多演示