以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 1、怎么实现tabbar跟随任何页面都显示在底部 2、怎么实现页面打开后,指定的tabbar对应的卡片栏被选择 比如page3_btn默认被点击 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=171512) |
-- 作者:cnsjroom -- 发布时间:2021/9/1 17:06:00 -- 1、怎么实现tabbar跟随任何页面都显示在底部 2、怎么实现页面打开后,指定的tabbar对应的卡片栏被选择 比如page3_btn默认被点击 麻烦老师帮忙看看TabBar: 1、怎么实现tabbar跟随任何页面都显示在底部 2、怎么实现页面打开后,指定的tabbar对应的卡片栏被选择 比如page3_btn默认被点击 (下述代码并没有实现默认点击page3_btn) 当前代码app页面如下: Dim e As RequestEventArgs = args(0) Dim wb As New weui wb.AddForm("","form1","app.htm") With wb.AddTabBar("", "tb1", 0) .AddPage("page1","线索举报","./images/h11.ico").Attribute = "style=\'height: 100%;\'" .AddPage("page2","线索征集","./images/f5.ico").Attribute = "style=\'height: 100%;\'" .AddPage("page3","法制宣传","./images/f2.ico").Attribute = "style=\'height: 100%;\'" .AddPage("page4","个人中心","/images/f8.ico").Attribute = "style=\'height: 100%;\'" End With wb.InsertHTML("page1","<div id=\'divpage1\'></div>") wb.InsertHTML("<script>document.getElementById(\'page1_btn\').click();</script>") wb.AppendHTML("<script>document.getElementById(\'page1_btn\').addEventListener(\'click\',function(){document.getElementById(\'divpage1\').innerHTML=sendAjaxText(\'ceshi\',\'ceshi.htm\',\'\',false);},false);</script>") wb.InsertHTML("page2","<div id=\'divpage2\'></div>") wb.InsertHTML("<script>document.getElementById(\'page2_btn\').click();</script>") wb.AppendHTML("<script>document.getElementById(\'page2_btn\').addEventListener(\'click\',function(){document.getElementById(\'divpage2\').innerHTML=sendAjaxText(\'zhengji\',\'zhengji.htm\',\'\',false);},false);</script>") wb.InsertHTML("page3","<div id=\'divpage3\'></div>") wb.InsertHTML("<script>document.getElementById(\'page3_btn\').click();</script>") wb.AppendHTML("<script>document.getElementById(\'page3_btn\').addEventListener(\'click\',function(){document.getElementById(\'divpage3\').innerHTML=sendAjaxText(\'fzyemian\',\'fzyemian.htm\',\'\',false);},false);document.getElementById(\'page3_btn\').click();</script>") wb.InsertHTML("page4","<div id=\'divpage4\'></div>") wb.InsertHTML("<script>document.getElementById(\'page4_btn\').click();</script>") wb.AppendHTML("<script>document.getElementById(\'page4_btn\').addEventListener(\'click\',function(){document.getElementById(\'divpage4\').innerHTML=sendAjaxText(\'login\',\'login.htm\',\'\',false);},false);</script>") e.WriteString(wb.Build)
[此贴子已经被作者于2021/9/1 17:16:18编辑过]
|
-- 作者:有点蓝 -- 发布时间:2021/9/1 17:14:00 -- 1、默认就是固定在底部的,如果不是,说明自己添加的第三方的内容破坏了原布局 2、wb.AppendHTML("<script>hide(\'page1\');show(\'page3\')</script>") |