English 中文(简体)
动态图表
原标题:Dynamic paging using divs and Javascript

我有一张纪录片,制作一张桌子,每9个物品在桌旁打一片,基本上看着:

<div>
<table>rs1, rs2 ----> rs9</table>
</div>
<div>
<table>rs10, rs11 ----> rs18</table>
</div>

etc...

现在,我只想这样做,首先只想看到第一个四分之二,而其他部分是隐蔽的,但我有伙伴关系,为各种四分五点(网页)提供可点击的链接,并点击任何特定的链接,将显示四分五裂和隐藏所有其他部分。

这里是我迄今为止的《标准法典》:

Dim i
  If totalPages > 1 Then
    Response.Write("<div id= navigation >")
  For i=1 to totalPages
      Response.Write ("<a href=   onlick=  >"& i &"</a> | ")
  Next
  Response.Write("</div>")
  End If

现在,我只是需要宣读“ j”。

最佳回答

为使会议更加方便,你应确定您的表格。 给他们一个识别具体结果和确定所有结果的类别名称的身份证:

<table id="resultset-1" class="resultset"> ...

然后,你可以把事件与你的导航要素之间的联系联系起来:

window.onload = function() {
    document
        .getElementById( navigation )
        .getElementByTagName( a )
        .onclick = function() {
            var id = parseInt(this.innerHTML, 10);
            document.getElementsByClassName( resultset ).style.display =  none ;
            document.getElementById( resultset- +id).style.display =  block ;
            return false;
        }
}

我没有经过测试,我的范式联合研究技能是一比空文,但我的理解是,它should<>工作。 就座椅而言,我可以保证:

$(function() {
    $( #navigation a ).click(function() {
        var id = parseInt($(this).html(), 10);
        $( .resultset ).hide();
        $( #resultset- +id).show();
        return false;
    });
});

只想隐藏除头 d——你不需要为此使用联合材料,你可以把伙伴关系用于印刷<代码> 字面=”的显示:无;“到你想要隐藏的所有表格。

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!