用于制作不需要版本的选项卡的JavaScript?

用于制作不需要版本的选项卡的JavaScript?,javascript,html,tabs,Javascript,Html,Tabs,我需要JavaScript的标签,不需要编辑它将是不可能的 我有三个链接和三个div,我需要这样的东西,在链接推会显示一个div,其他隐藏,在其他链接推,显示其他div和所有其他隐藏的 这是我的密码: <div style="text-align: left;"> <ul style="margin: 0 0 0 0;"> <li style="display:inline; margin-left: 3px;

我需要JavaScript的标签,不需要编辑它将是不可能的

我有三个链接和三个div,我需要这样的东西,在链接推会显示一个div,其他隐藏,在其他链接推,显示其他div和所有其他隐藏的

这是我的密码:

<div style="text-align: left;">
            <ul style="margin: 0 0 0 0;">
                <li style="display:inline; margin-left: 3px; text-align: center; width:90px; background-color:#58794c; border-top:1px dotted #015811; border-left:1px dotted #015811; border-right:1px dotted #015811;"><a style="color: #ffffff; font-size: 28px; text-decoration: none;" href="#">Postage</a></li>
                <li style="display:inline; margin-left: 3px; text-align: center; width:90px; background-color:#558b40; border-top:1px dotted #015811; border-left:1px dotted #015811; border-right:1px dotted #015811;"><a style="color: #efda5d; font-size: 28px; text-decoration: none;" href="#">Return</a></li>
                <li style="display:inline; margin-left: 3px; text-align: center; width:90px; background-color:#66ac4a; border-top:1px dotted #015811; border-left:1px dotted #015811; border-right:1px dotted #015811;"><a style="color: #efda5d; font-size: 28px; text-decoration: none;" href="#">Payment</a></li>
            </ul>
        </div>
        <div style="width:324px; background-color:#58794c; color: #efda5d; border-bottom:1px dotted #015811; border-left:1px dotted #015811; border-right:1px dotted #015811;" title="Shipping information"><p style="text-align: left; margin-left: 10; margin-top:0;">Available shipping type/It's price/Additional cost for this product:<br />[[ShippingService1]]/[[ShippingServiceCost1]]/[[ShippingServiceAdditionalCost1]]<br />[[ShippingService2]]/[[ShippingServiceCost2]]/[[ShippingServiceAdditionalCost2]]<br />[[ShippingService3]]/[[ShippingServiceCost3]]/[[ShippingServiceAdditionalCost3]]<br />More information about products delivery you will find by clicking <a style="color: #ffffff;" href="http://stores.ebay.co.uk/Digi-Spot/Delivery.html">here</a>.</p></div>
        <div style="width:324px; background-color:#558b40; color: #efda5d; border-bottom:1px dotted #015811; border-left:1px dotted #015811; border-right:1px dotted #015811;" title="Return information"><p style="text-align: left; margin-left: 10; margin-top:0;">Product must be returned within [[ReturnWithin]] to this adress <b>[[ReturnAddress]]</b>. For return shipping pays <b>[[ReturnShipPaid]]</b>.<br /> More information about returning products you will find by clicking <a style="color: #ffffff;" href="http://stores.ebay.co.uk/Digi-Spot/Returns.html">here</a>.</p></div>
        <div style="width:324px; background-color:#66ac4a; color: #efda5d; border-bottom:1px dotted #015811; border-left:1px dotted #015811; border-right:1px dotted #015811;" title="Payment information"><p style="text-align: left; margin-left: 10; margin-top:0;">Product price is <b>[[FixedPrice]]</b><br />Additional payment instructions for this product: [[PaymentInstructions]]</p></div>
下面是我想要的一个例子:


可能我需要添加div名称或id,并具有显示或隐藏链接单击时将执行的div的简单功能,但我找不到不需要编辑的div。

正如昆廷在对您的问题的评论中所说,实际上,任何提供tabs小部件或任何其他构建选项卡的解决方案的JavaScript库都不需要在页面的某个部分执行任何操作。好实际上是这样的,当您在那里调用外部JavaScript文件时:

<script type="text/javascript" src="libs.js"></script>
但这只是保持代码整洁的一种形式。如果你不太喜欢head,你可以在你所在的区域内的任何地方放一条几乎相同的线,它也应该可以工作

因此,如果可能每个JavaScript库提供的选项卡都可以在不修改的情况下工作,那么让我们使用世界上最著名或几乎最著名的

正如您在给定的示例中所看到的,单击查看源代码,要获得选项卡,您所要做的就是将如下内容放入您的页面:

<div id="tabs">
    <ul>
        <li><a href="#tabs-1">Tab 1 Title</a></li>
        <li><a href="#tabs-2">Tab 2 Title</a></li>
        <li><a href="#tabs-3">Tab 3 Title</a></li>
    </ul>
    <div id="tabs-1">
        <p>Tab 1 Text</p>
    </div>
    <div id="tabs-2">
        <p>Tab 2 Text</p>
    </div>
    <div id="tabs-3">
        <p>Tab 3 Text</p>
    </div>
</div>
然后,jQuery UI作者再次向您展示,您应该将对最新版本的jQuery和jQuery UI LIB的调用放入您的部分:

但是,正如我写给您的,您也可以将其放在任何地方,例如,在用于声明选项卡之前:

<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<div id="tabs">
    <ul>
    ...

就这些,伙计们!:]

欢迎来到堆栈溢出。请注意,post系统接受某些HTML标记,因此当需要显示文字标记时,必须使用{}工具栏按钮将它们标记为代码。这一次我已经帮你做了。我需要JavaScript用于不需要版本的标签,这是不可能的。-这是任何选项卡库,即使不是这样,如果你不能修改头部,那么你需要要么修复你的CMS,要么修复不允许你修改的商业文化,因为iteBay不允许在列表模板中编辑头部。无论如何,谢谢你的建议嘿!你们怎么了?不要仅仅因为这个问题看起来很琐碎或者问得不正确就否决它!礼貌一点!尝试解决问题或帮助。任何人都可以投反对票,只有少数人可以帮忙。。。
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<div id="tabs">
    <ul>
    ...