LungoJS框架学习笔记——绑定

来源:互联网 发布:真人变卡通人物软件 编辑:程序博客网 时间:2024/05/21 10:57
1) Title 绑定 
在导航条元素里运用 data-title 属性可以更换对应 section 的标题。
<section id="main">    <header data-title="默认标题"></header>    <article id="first" class="active">        <button data-view-article="second" data-title="目前显示的是按钮二">按钮一</button>    </article>    <article id="second">        <button data-view-article="first" data-title="目前显示的是按钮一">按钮二</button>    </article></section>
效果图:
2) Element 绑定
可以通过 data-article 属性来实现显示不同页面内容的切换按钮。
<section id="main">    <header data-title="Element 绑定示例">        <nav class="on-right">            <button data-article="second" data-view-article="first">第一页</button>            <button data-article="first" data-view-article="second">第二页</button>        </nav>    </header>    <article id="first" class="active">目前显示的是第一页内容</article>    <article id="second">目前显示的是第二页内容</article></section>
效果图:
                                             
0 0