如何将Dropbox放入Iframe?

时间:2017-09-17 10:23:24

标签: javascript jquery html iframe

我有dropbox:

<div id='jqxDropDownList'></div>

和js:

  var source = [
      "Affogato",
      "Americano",
      "Bicerin",
      "Breve",
      "Café Bombón",
      "Café au lait"];
  // Create a jqxDropDownList
  $("#jqxDropDownList").jqxDropDownList({
      source: source,
      selectedIndex: 3,
      theme: 'energyblue',
      checkboxes:true
});

这个iframe:

<iframe></iframe>

此处如果fiddler

我的问题是如何将Dropbox放入Iframe?

1 个答案:

答案 0 :(得分:1)

您需要将iframe指向src,因此您的代码需要位于另一个页面中,因为它是:

https://jsfiddle.net/Lp0qgsjd/包含<iframe src="https://jsfiddle.net/CLB86/320/show"></iframe>http://jsfiddle.net/CLB86/320/包含您的代码:

<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.base.css"/>
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css"/>
<script src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<div id='jqxDropDownList'></div>

和js:

var source = [
  "Affogato",
  "Americano",
  "Bicerin",
  "Breve",
  "Café Bombón",
  "Café au lait"];
// Create a jqxDropDownList
$("#jqxDropDownList").jqxDropDownList({
  source: source,
  selectedIndex: 3,
  theme: 'energyblue',
  checkboxes:true
});