- 注册时间
- 2021-8-2
- 最后登录
- 2021-8-2
- 阅读权限
- 10
- 积分
- 15
- 精华
- 0
- 帖子
- 6
|
felt 发表于 2021-8-2 13:05
什么valuechanged事件做个简单的例子上传上来,我看看 - <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>demo</title>
- </head>
- <script src="jslib/jquery/jquery-1.8.3-min.js"></script>
- <script src="jslib/miniui/boot.js"></script>
- <body>
- <div id="mytabs" class="mini-tabs">
- <div title="wa"></div>
- <div title="ng"></div>
- </div>
- <div id="btn" class="mini-button">重新产生tab</div>
- </body>
- <script>
- mini.parse();
- var $tabs = mini.get("mytabs");
- var $btn = mini.get("btn");
- $tabs.on('activechanged',function () {
- //点击按钮后此处会报错
- console.info("当前title"+$tabs.getActiveTab().title);
- });
- $btn.on('click',conTab);
- function conTab(){
- var titles = [];
- for (var i = 0; i < 5; i++) {
- titles.push({"title":"tab"+i});
- }
- $tabs.setTabs(titles);
- }
- </script>
- </html>
复制代码 |
|