以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  动态显示隐藏  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=107635)

--  作者:lshshlxsh
--  发布时间:2017/10/6 9:19:00
--  动态显示隐藏
Select Case e.Path
    Case "test.htm"
        Dim wb As New WeUI
        Dim txt As String = "由各种物质组成的巨型球状天体,叫做星球.星球有一定的形状,有自己的运行轨道."
        With wb.AddPanelGroup("","pg1","图文组合列表")
            With .Add("pn2","标题二",txt,"./images/search.png")
                .AddFoot("<a href="" ""Return dj("  & "\'div1\')"""  & ">"  & "详情</a>" ,""")
                .AddFoot("<div id=\'div1\' style=\'display:none\'>显示隐藏</div>")                
            End With
        End With
        e.WriteString(wb.Build) \'生成网页
End Select


请问一下 我点击详情 怎么显示 和隐藏 div 控件?




我下面这段代码直接写在test.htm 是可以显示隐藏的
 <script language="javascript" type="text/javascript">
function dj(divDisplay){if(document.getElementById(divDisplay).style.display != "block"){document.getElementById(divDisplay).style.display = "block";}else{document.getElementById(divDisplay).style.display = "none";}}</script>
  <div>


<a >打开</a>
        <div id="div1" style="display:none;">div1下面的内容</div>
    </div>

[此贴子已经被作者于2017/10/6 10:04:45编辑过]

--  作者:有点甜
--  发布时间:2017/10/6 10:07:00
--  

Select Case e.Path
    Case "test.htm"
        Dim wb As New WeUI
        Dim txt As String = "由各种物质组成的巨型球状天体,叫做星球.星球有一定的形状,有自己的运行轨道."
        With wb.AddPanelGroup("","pg1","图文组合列表")
            With .Add("pn2","标题二",txt,"./images/search.png")
                .AddFoot("<a href=\'#\' onclick=""if(div1.style.display==\'none\'){div1.style.display=\'block\'}else{div1.style.display=\'none\'};return false "">详情</a>")
                .AddFoot("<div id=\'div1\' style=\'display:none\'>显示隐藏</div>")               
            End With
        End With
        e.WriteString(wb.Build) \'生成网页
End Select

--  作者:lshshlxsh
--  发布时间:2017/10/6 10:38:00
--  
谢谢老师图片点击可在新窗口打开查看