dojo:应用程序页眉/页脚栏

时间:2016-11-20 16:55:57

标签: javascript html css dojo

我正在尝试复制文档中描述的“应用程序页眉/页脚”栏:

https://dojotoolkit.org/reference-guide/1.10/dojox/mobile/ScrollableView.html

医生说:

  

制作条形小部件(标题,标签栏或自定义条形小部件)>固定定位,

     
      
  1. 将其放在ScrollableView
  2. 之外   
  3. 为标题栏添加固定:“top”,或修复:页脚栏的“bottom”
  4.   

我在这里复制/粘贴了例子:

<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.8.3/dojox/mobile/deviceTheme.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/dojo/1.11.2/dojo/dojo.js" djConfig="parseOnLoad: true"></script>

<div data-dojo-type="dojox/mobile/View" data-dojo-props="selected:true">
  <div data-dojo-type="dojox/mobile/RoundRect">
    <form data-dojo-type="dojox/mobile/FormLayout" data-dojo-props="columns: 'single'">
      <div>
        <label>
          <strong>Username</strong>
        </label>
        <fieldset>
          <input type="text" data-dojo-type="dojox/mobile/TextBox">
        </fieldset>
      </div>
      <div>
        <label><strong>Password</strong>
        </label>
        <fieldset>
          <input type="password" data-dojo-type="dojox/mobile/TextBox">
        </fieldset>
      </div>
      <input id="btnLogin" type="submit" data-dojo-type="dojox/mobile/Button" value="Login" class="mblBlueButton">
    </form>
  </div>
  <div data-dojo-type="dojox/mobile/SimpleDialog">
    <div class="mblSimpleDialogTitle">Title</div>
    <div class="mblSimpleDialogText">Text</div>
    <button data-dojo-type="dojox/mobile/Button" data-dojo-props="label:'Ok'"></button>
  </div>
</div>
<h1 data-dojo-type="dojox/mobile/Heading" data-dojo-props='fixed:"bottom"'>Application Footer Bar</h1>

但是你可以看到它与doc页面上的相同示例完全不同。我说的是页脚栏应位于页面底部,而不是位于视图的末尾。

他们没有说任何关于任何自定义CSS规则,因此我想知道我在这里缺少什么。

更新

将主题应用到代码段后,我能够重现原始代码中的实际(错误)行为:

<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.8.3/dojox/mobile/deviceTheme.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/dojo/1.11.2/dojo/dojo.js" djConfig="parseOnLoad: true"></script>

<div data-dojo-type="dojox/mobile/View" data-dojo-props="selected:true">
  <div data-dojo-type="dojox/mobile/RoundRect">
    <form data-dojo-type="dojox/mobile/FormLayout" data-dojo-props="columns: 'single'">
      <div>
        <label>
          <strong>Username</strong>
        </label>
        <fieldset>
          <input type="text" data-dojo-type="dojox/mobile/TextBox">
        </fieldset>
      </div>
      <div>
        <label><strong>Password</strong>
        </label>
        <fieldset>
          <input type="password" data-dojo-type="dojox/mobile/TextBox">
        </fieldset>
      </div>
      <input id="btnLogin" type="submit" data-dojo-type="dojox/mobile/Button" value="Login" class="mblBlueButton">
    </form>
  </div>
  <div data-dojo-type="dojox/mobile/SimpleDialog">
    <div class="mblSimpleDialogTitle">Title</div>
    <div class="mblSimpleDialogText">Text</div>
    <button data-dojo-type="dojox/mobile/Button" data-dojo-props="label:'Ok'"></button>
  </div>
</div>
<h1 data-dojo-type="dojox/mobile/Heading" data-dojo-props='fixed:"bottom"'>Application Footer Bar</h1>

如果你去整页,你会看到“应用程序页脚栏”浮动在内容结尾的下方,而不是固定在页面底部,按照上一个片段。

1 个答案:

答案 0 :(得分:1)

检查以下示例 -

&#13;
&#13;
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.8.3/dojox/mobile/deviceTheme.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/dojo/1.11.2/dojo/dojo.js" djConfig="parseOnLoad: true"></script>

<h1 data-dojo-type="dojox/mobile/Heading" data-dojo-props='fixed:"top"'>Application Header Bar</h1>
<div id="view1" data-dojo-type="dojox/mobile/ScrollableView">
  View1
</div>
<div id="view2" data-dojo-type="dojox/mobile/ScrollableView">
  View2
</div>
<h1 data-dojo-type="dojox/mobile/Heading" data-dojo-props='fixed:"bottom"'>Application Footer Bar</h1>
&#13;
&#13;
&#13;

希望这对你有帮助。